Termination w.r.t. Q of the following Term Rewriting System could not be shown:

Q restricted rewrite system:
The TRS R consists of the following rules:

active(primes) → mark(sieve(from(s(s(0)))))
active(from(X)) → mark(cons(X, from(s(X))))
active(head(cons(X, Y))) → mark(X)
active(tail(cons(X, Y))) → mark(Y)
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(filter(s(s(X)), cons(Y, Z))) → mark(if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y)))))
active(sieve(cons(X, Y))) → mark(cons(X, filter(X, sieve(Y))))
mark(primes) → active(primes)
mark(sieve(X)) → active(sieve(mark(X)))
mark(from(X)) → active(from(mark(X)))
mark(s(X)) → active(s(mark(X)))
mark(0) → active(0)
mark(cons(X1, X2)) → active(cons(mark(X1), X2))
mark(head(X)) → active(head(mark(X)))
mark(tail(X)) → active(tail(mark(X)))
mark(if(X1, X2, X3)) → active(if(mark(X1), X2, X3))
mark(true) → active(true)
mark(false) → active(false)
mark(filter(X1, X2)) → active(filter(mark(X1), mark(X2)))
mark(divides(X1, X2)) → active(divides(mark(X1), mark(X2)))
sieve(mark(X)) → sieve(X)
sieve(active(X)) → sieve(X)
from(mark(X)) → from(X)
from(active(X)) → from(X)
s(mark(X)) → s(X)
s(active(X)) → s(X)
cons(mark(X1), X2) → cons(X1, X2)
cons(X1, mark(X2)) → cons(X1, X2)
cons(active(X1), X2) → cons(X1, X2)
cons(X1, active(X2)) → cons(X1, X2)
head(mark(X)) → head(X)
head(active(X)) → head(X)
tail(mark(X)) → tail(X)
tail(active(X)) → tail(X)
if(mark(X1), X2, X3) → if(X1, X2, X3)
if(X1, mark(X2), X3) → if(X1, X2, X3)
if(X1, X2, mark(X3)) → if(X1, X2, X3)
if(active(X1), X2, X3) → if(X1, X2, X3)
if(X1, active(X2), X3) → if(X1, X2, X3)
if(X1, X2, active(X3)) → if(X1, X2, X3)
filter(mark(X1), X2) → filter(X1, X2)
filter(X1, mark(X2)) → filter(X1, X2)
filter(active(X1), X2) → filter(X1, X2)
filter(X1, active(X2)) → filter(X1, X2)
divides(mark(X1), X2) → divides(X1, X2)
divides(X1, mark(X2)) → divides(X1, X2)
divides(active(X1), X2) → divides(X1, X2)
divides(X1, active(X2)) → divides(X1, X2)

Q is empty.


QTRS
  ↳ DependencyPairsProof

Q restricted rewrite system:
The TRS R consists of the following rules:

active(primes) → mark(sieve(from(s(s(0)))))
active(from(X)) → mark(cons(X, from(s(X))))
active(head(cons(X, Y))) → mark(X)
active(tail(cons(X, Y))) → mark(Y)
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(filter(s(s(X)), cons(Y, Z))) → mark(if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y)))))
active(sieve(cons(X, Y))) → mark(cons(X, filter(X, sieve(Y))))
mark(primes) → active(primes)
mark(sieve(X)) → active(sieve(mark(X)))
mark(from(X)) → active(from(mark(X)))
mark(s(X)) → active(s(mark(X)))
mark(0) → active(0)
mark(cons(X1, X2)) → active(cons(mark(X1), X2))
mark(head(X)) → active(head(mark(X)))
mark(tail(X)) → active(tail(mark(X)))
mark(if(X1, X2, X3)) → active(if(mark(X1), X2, X3))
mark(true) → active(true)
mark(false) → active(false)
mark(filter(X1, X2)) → active(filter(mark(X1), mark(X2)))
mark(divides(X1, X2)) → active(divides(mark(X1), mark(X2)))
sieve(mark(X)) → sieve(X)
sieve(active(X)) → sieve(X)
from(mark(X)) → from(X)
from(active(X)) → from(X)
s(mark(X)) → s(X)
s(active(X)) → s(X)
cons(mark(X1), X2) → cons(X1, X2)
cons(X1, mark(X2)) → cons(X1, X2)
cons(active(X1), X2) → cons(X1, X2)
cons(X1, active(X2)) → cons(X1, X2)
head(mark(X)) → head(X)
head(active(X)) → head(X)
tail(mark(X)) → tail(X)
tail(active(X)) → tail(X)
if(mark(X1), X2, X3) → if(X1, X2, X3)
if(X1, mark(X2), X3) → if(X1, X2, X3)
if(X1, X2, mark(X3)) → if(X1, X2, X3)
if(active(X1), X2, X3) → if(X1, X2, X3)
if(X1, active(X2), X3) → if(X1, X2, X3)
if(X1, X2, active(X3)) → if(X1, X2, X3)
filter(mark(X1), X2) → filter(X1, X2)
filter(X1, mark(X2)) → filter(X1, X2)
filter(active(X1), X2) → filter(X1, X2)
filter(X1, active(X2)) → filter(X1, X2)
divides(mark(X1), X2) → divides(X1, X2)
divides(X1, mark(X2)) → divides(X1, X2)
divides(active(X1), X2) → divides(X1, X2)
divides(X1, active(X2)) → divides(X1, X2)

Q is empty.

Using Dependency Pairs [1,15] we result in the following initial DP problem:
Q DP problem:
The TRS P consists of the following rules:

ACTIVE(filter(s(s(X)), cons(Y, Z))) → FILTER(X, sieve(Y))
FROM(mark(X)) → FROM(X)
TAIL(active(X)) → TAIL(X)
MARK(head(X)) → MARK(X)
MARK(tail(X)) → MARK(X)
FILTER(active(X1), X2) → FILTER(X1, X2)
MARK(cons(X1, X2)) → MARK(X1)
CONS(X1, mark(X2)) → CONS(X1, X2)
FROM(active(X)) → FROM(X)
SIEVE(mark(X)) → SIEVE(X)
ACTIVE(filter(s(s(X)), cons(Y, Z))) → MARK(if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y)))))
HEAD(mark(X)) → HEAD(X)
ACTIVE(filter(s(s(X)), cons(Y, Z))) → IF(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y))))
MARK(true) → ACTIVE(true)
ACTIVE(filter(s(s(X)), cons(Y, Z))) → CONS(Y, filter(X, sieve(Y)))
MARK(sieve(X)) → ACTIVE(sieve(mark(X)))
MARK(if(X1, X2, X3)) → MARK(X1)
IF(X1, X2, mark(X3)) → IF(X1, X2, X3)
DIVIDES(X1, active(X2)) → DIVIDES(X1, X2)
DIVIDES(mark(X1), X2) → DIVIDES(X1, X2)
ACTIVE(from(X)) → MARK(cons(X, from(s(X))))
MARK(head(X)) → HEAD(mark(X))
ACTIVE(sieve(cons(X, Y))) → CONS(X, filter(X, sieve(Y)))
S(active(X)) → S(X)
MARK(filter(X1, X2)) → FILTER(mark(X1), mark(X2))
MARK(tail(X)) → TAIL(mark(X))
MARK(cons(X1, X2)) → CONS(mark(X1), X2)
MARK(false) → ACTIVE(false)
FILTER(X1, active(X2)) → FILTER(X1, X2)
MARK(tail(X)) → ACTIVE(tail(mark(X)))
HEAD(active(X)) → HEAD(X)
FILTER(X1, mark(X2)) → FILTER(X1, X2)
TAIL(mark(X)) → TAIL(X)
CONS(active(X1), X2) → CONS(X1, X2)
DIVIDES(active(X1), X2) → DIVIDES(X1, X2)
ACTIVE(primes) → S(0)
ACTIVE(from(X)) → FROM(s(X))
CONS(mark(X1), X2) → CONS(X1, X2)
MARK(primes) → ACTIVE(primes)
FILTER(mark(X1), X2) → FILTER(X1, X2)
MARK(filter(X1, X2)) → MARK(X2)
MARK(s(X)) → MARK(X)
ACTIVE(sieve(cons(X, Y))) → MARK(cons(X, filter(X, sieve(Y))))
ACTIVE(if(false, X, Y)) → MARK(Y)
MARK(from(X)) → FROM(mark(X))
ACTIVE(sieve(cons(X, Y))) → FILTER(X, sieve(Y))
CONS(X1, active(X2)) → CONS(X1, X2)
MARK(s(X)) → ACTIVE(s(mark(X)))
SIEVE(active(X)) → SIEVE(X)
ACTIVE(filter(s(s(X)), cons(Y, Z))) → DIVIDES(s(s(X)), Y)
ACTIVE(primes) → SIEVE(from(s(s(0))))
ACTIVE(filter(s(s(X)), cons(Y, Z))) → FILTER(s(s(X)), Z)
IF(X1, mark(X2), X3) → IF(X1, X2, X3)
MARK(divides(X1, X2)) → DIVIDES(mark(X1), mark(X2))
IF(X1, X2, active(X3)) → IF(X1, X2, X3)
S(mark(X)) → S(X)
MARK(from(X)) → MARK(X)
MARK(s(X)) → S(mark(X))
MARK(if(X1, X2, X3)) → IF(mark(X1), X2, X3)
MARK(cons(X1, X2)) → ACTIVE(cons(mark(X1), X2))
MARK(divides(X1, X2)) → MARK(X2)
MARK(divides(X1, X2)) → ACTIVE(divides(mark(X1), mark(X2)))
MARK(filter(X1, X2)) → ACTIVE(filter(mark(X1), mark(X2)))
MARK(if(X1, X2, X3)) → ACTIVE(if(mark(X1), X2, X3))
IF(active(X1), X2, X3) → IF(X1, X2, X3)
IF(mark(X1), X2, X3) → IF(X1, X2, X3)
ACTIVE(primes) → FROM(s(s(0)))
ACTIVE(primes) → S(s(0))
MARK(head(X)) → ACTIVE(head(mark(X)))
ACTIVE(filter(s(s(X)), cons(Y, Z))) → SIEVE(Y)
ACTIVE(primes) → MARK(sieve(from(s(s(0)))))
MARK(filter(X1, X2)) → MARK(X1)
MARK(sieve(X)) → SIEVE(mark(X))
DIVIDES(X1, mark(X2)) → DIVIDES(X1, X2)
ACTIVE(from(X)) → S(X)
ACTIVE(sieve(cons(X, Y))) → SIEVE(Y)
MARK(from(X)) → ACTIVE(from(mark(X)))
IF(X1, active(X2), X3) → IF(X1, X2, X3)
MARK(divides(X1, X2)) → MARK(X1)
ACTIVE(head(cons(X, Y))) → MARK(X)
MARK(0) → ACTIVE(0)
MARK(sieve(X)) → MARK(X)
ACTIVE(from(X)) → CONS(X, from(s(X)))
ACTIVE(if(true, X, Y)) → MARK(X)
ACTIVE(tail(cons(X, Y))) → MARK(Y)

The TRS R consists of the following rules:

active(primes) → mark(sieve(from(s(s(0)))))
active(from(X)) → mark(cons(X, from(s(X))))
active(head(cons(X, Y))) → mark(X)
active(tail(cons(X, Y))) → mark(Y)
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(filter(s(s(X)), cons(Y, Z))) → mark(if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y)))))
active(sieve(cons(X, Y))) → mark(cons(X, filter(X, sieve(Y))))
mark(primes) → active(primes)
mark(sieve(X)) → active(sieve(mark(X)))
mark(from(X)) → active(from(mark(X)))
mark(s(X)) → active(s(mark(X)))
mark(0) → active(0)
mark(cons(X1, X2)) → active(cons(mark(X1), X2))
mark(head(X)) → active(head(mark(X)))
mark(tail(X)) → active(tail(mark(X)))
mark(if(X1, X2, X3)) → active(if(mark(X1), X2, X3))
mark(true) → active(true)
mark(false) → active(false)
mark(filter(X1, X2)) → active(filter(mark(X1), mark(X2)))
mark(divides(X1, X2)) → active(divides(mark(X1), mark(X2)))
sieve(mark(X)) → sieve(X)
sieve(active(X)) → sieve(X)
from(mark(X)) → from(X)
from(active(X)) → from(X)
s(mark(X)) → s(X)
s(active(X)) → s(X)
cons(mark(X1), X2) → cons(X1, X2)
cons(X1, mark(X2)) → cons(X1, X2)
cons(active(X1), X2) → cons(X1, X2)
cons(X1, active(X2)) → cons(X1, X2)
head(mark(X)) → head(X)
head(active(X)) → head(X)
tail(mark(X)) → tail(X)
tail(active(X)) → tail(X)
if(mark(X1), X2, X3) → if(X1, X2, X3)
if(X1, mark(X2), X3) → if(X1, X2, X3)
if(X1, X2, mark(X3)) → if(X1, X2, X3)
if(active(X1), X2, X3) → if(X1, X2, X3)
if(X1, active(X2), X3) → if(X1, X2, X3)
if(X1, X2, active(X3)) → if(X1, X2, X3)
filter(mark(X1), X2) → filter(X1, X2)
filter(X1, mark(X2)) → filter(X1, X2)
filter(active(X1), X2) → filter(X1, X2)
filter(X1, active(X2)) → filter(X1, X2)
divides(mark(X1), X2) → divides(X1, X2)
divides(X1, mark(X2)) → divides(X1, X2)
divides(active(X1), X2) → divides(X1, X2)
divides(X1, active(X2)) → divides(X1, X2)

Q is empty.
We have to consider all minimal (P,Q,R)-chains.

↳ QTRS
  ↳ DependencyPairsProof
QDP
      ↳ DependencyGraphProof

Q DP problem:
The TRS P consists of the following rules:

ACTIVE(filter(s(s(X)), cons(Y, Z))) → FILTER(X, sieve(Y))
FROM(mark(X)) → FROM(X)
TAIL(active(X)) → TAIL(X)
MARK(head(X)) → MARK(X)
MARK(tail(X)) → MARK(X)
FILTER(active(X1), X2) → FILTER(X1, X2)
MARK(cons(X1, X2)) → MARK(X1)
CONS(X1, mark(X2)) → CONS(X1, X2)
FROM(active(X)) → FROM(X)
SIEVE(mark(X)) → SIEVE(X)
ACTIVE(filter(s(s(X)), cons(Y, Z))) → MARK(if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y)))))
HEAD(mark(X)) → HEAD(X)
ACTIVE(filter(s(s(X)), cons(Y, Z))) → IF(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y))))
MARK(true) → ACTIVE(true)
ACTIVE(filter(s(s(X)), cons(Y, Z))) → CONS(Y, filter(X, sieve(Y)))
MARK(sieve(X)) → ACTIVE(sieve(mark(X)))
MARK(if(X1, X2, X3)) → MARK(X1)
IF(X1, X2, mark(X3)) → IF(X1, X2, X3)
DIVIDES(X1, active(X2)) → DIVIDES(X1, X2)
DIVIDES(mark(X1), X2) → DIVIDES(X1, X2)
ACTIVE(from(X)) → MARK(cons(X, from(s(X))))
MARK(head(X)) → HEAD(mark(X))
ACTIVE(sieve(cons(X, Y))) → CONS(X, filter(X, sieve(Y)))
S(active(X)) → S(X)
MARK(filter(X1, X2)) → FILTER(mark(X1), mark(X2))
MARK(tail(X)) → TAIL(mark(X))
MARK(cons(X1, X2)) → CONS(mark(X1), X2)
MARK(false) → ACTIVE(false)
FILTER(X1, active(X2)) → FILTER(X1, X2)
MARK(tail(X)) → ACTIVE(tail(mark(X)))
HEAD(active(X)) → HEAD(X)
FILTER(X1, mark(X2)) → FILTER(X1, X2)
TAIL(mark(X)) → TAIL(X)
CONS(active(X1), X2) → CONS(X1, X2)
DIVIDES(active(X1), X2) → DIVIDES(X1, X2)
ACTIVE(primes) → S(0)
ACTIVE(from(X)) → FROM(s(X))
CONS(mark(X1), X2) → CONS(X1, X2)
MARK(primes) → ACTIVE(primes)
FILTER(mark(X1), X2) → FILTER(X1, X2)
MARK(filter(X1, X2)) → MARK(X2)
MARK(s(X)) → MARK(X)
ACTIVE(sieve(cons(X, Y))) → MARK(cons(X, filter(X, sieve(Y))))
ACTIVE(if(false, X, Y)) → MARK(Y)
MARK(from(X)) → FROM(mark(X))
ACTIVE(sieve(cons(X, Y))) → FILTER(X, sieve(Y))
CONS(X1, active(X2)) → CONS(X1, X2)
MARK(s(X)) → ACTIVE(s(mark(X)))
SIEVE(active(X)) → SIEVE(X)
ACTIVE(filter(s(s(X)), cons(Y, Z))) → DIVIDES(s(s(X)), Y)
ACTIVE(primes) → SIEVE(from(s(s(0))))
ACTIVE(filter(s(s(X)), cons(Y, Z))) → FILTER(s(s(X)), Z)
IF(X1, mark(X2), X3) → IF(X1, X2, X3)
MARK(divides(X1, X2)) → DIVIDES(mark(X1), mark(X2))
IF(X1, X2, active(X3)) → IF(X1, X2, X3)
S(mark(X)) → S(X)
MARK(from(X)) → MARK(X)
MARK(s(X)) → S(mark(X))
MARK(if(X1, X2, X3)) → IF(mark(X1), X2, X3)
MARK(cons(X1, X2)) → ACTIVE(cons(mark(X1), X2))
MARK(divides(X1, X2)) → MARK(X2)
MARK(divides(X1, X2)) → ACTIVE(divides(mark(X1), mark(X2)))
MARK(filter(X1, X2)) → ACTIVE(filter(mark(X1), mark(X2)))
MARK(if(X1, X2, X3)) → ACTIVE(if(mark(X1), X2, X3))
IF(active(X1), X2, X3) → IF(X1, X2, X3)
IF(mark(X1), X2, X3) → IF(X1, X2, X3)
ACTIVE(primes) → FROM(s(s(0)))
ACTIVE(primes) → S(s(0))
MARK(head(X)) → ACTIVE(head(mark(X)))
ACTIVE(filter(s(s(X)), cons(Y, Z))) → SIEVE(Y)
ACTIVE(primes) → MARK(sieve(from(s(s(0)))))
MARK(filter(X1, X2)) → MARK(X1)
MARK(sieve(X)) → SIEVE(mark(X))
DIVIDES(X1, mark(X2)) → DIVIDES(X1, X2)
ACTIVE(from(X)) → S(X)
ACTIVE(sieve(cons(X, Y))) → SIEVE(Y)
MARK(from(X)) → ACTIVE(from(mark(X)))
IF(X1, active(X2), X3) → IF(X1, X2, X3)
MARK(divides(X1, X2)) → MARK(X1)
ACTIVE(head(cons(X, Y))) → MARK(X)
MARK(0) → ACTIVE(0)
MARK(sieve(X)) → MARK(X)
ACTIVE(from(X)) → CONS(X, from(s(X)))
ACTIVE(if(true, X, Y)) → MARK(X)
ACTIVE(tail(cons(X, Y))) → MARK(Y)

The TRS R consists of the following rules:

active(primes) → mark(sieve(from(s(s(0)))))
active(from(X)) → mark(cons(X, from(s(X))))
active(head(cons(X, Y))) → mark(X)
active(tail(cons(X, Y))) → mark(Y)
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(filter(s(s(X)), cons(Y, Z))) → mark(if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y)))))
active(sieve(cons(X, Y))) → mark(cons(X, filter(X, sieve(Y))))
mark(primes) → active(primes)
mark(sieve(X)) → active(sieve(mark(X)))
mark(from(X)) → active(from(mark(X)))
mark(s(X)) → active(s(mark(X)))
mark(0) → active(0)
mark(cons(X1, X2)) → active(cons(mark(X1), X2))
mark(head(X)) → active(head(mark(X)))
mark(tail(X)) → active(tail(mark(X)))
mark(if(X1, X2, X3)) → active(if(mark(X1), X2, X3))
mark(true) → active(true)
mark(false) → active(false)
mark(filter(X1, X2)) → active(filter(mark(X1), mark(X2)))
mark(divides(X1, X2)) → active(divides(mark(X1), mark(X2)))
sieve(mark(X)) → sieve(X)
sieve(active(X)) → sieve(X)
from(mark(X)) → from(X)
from(active(X)) → from(X)
s(mark(X)) → s(X)
s(active(X)) → s(X)
cons(mark(X1), X2) → cons(X1, X2)
cons(X1, mark(X2)) → cons(X1, X2)
cons(active(X1), X2) → cons(X1, X2)
cons(X1, active(X2)) → cons(X1, X2)
head(mark(X)) → head(X)
head(active(X)) → head(X)
tail(mark(X)) → tail(X)
tail(active(X)) → tail(X)
if(mark(X1), X2, X3) → if(X1, X2, X3)
if(X1, mark(X2), X3) → if(X1, X2, X3)
if(X1, X2, mark(X3)) → if(X1, X2, X3)
if(active(X1), X2, X3) → if(X1, X2, X3)
if(X1, active(X2), X3) → if(X1, X2, X3)
if(X1, X2, active(X3)) → if(X1, X2, X3)
filter(mark(X1), X2) → filter(X1, X2)
filter(X1, mark(X2)) → filter(X1, X2)
filter(active(X1), X2) → filter(X1, X2)
filter(X1, active(X2)) → filter(X1, X2)
divides(mark(X1), X2) → divides(X1, X2)
divides(X1, mark(X2)) → divides(X1, X2)
divides(active(X1), X2) → divides(X1, X2)
divides(X1, active(X2)) → divides(X1, X2)

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
The approximation of the Dependency Graph [15,17,22] contains 10 SCCs with 28 less nodes.

↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
QDP
            ↳ UsableRulesProof
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

DIVIDES(X1, active(X2)) → DIVIDES(X1, X2)
DIVIDES(active(X1), X2) → DIVIDES(X1, X2)
DIVIDES(mark(X1), X2) → DIVIDES(X1, X2)
DIVIDES(X1, mark(X2)) → DIVIDES(X1, X2)

The TRS R consists of the following rules:

active(primes) → mark(sieve(from(s(s(0)))))
active(from(X)) → mark(cons(X, from(s(X))))
active(head(cons(X, Y))) → mark(X)
active(tail(cons(X, Y))) → mark(Y)
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(filter(s(s(X)), cons(Y, Z))) → mark(if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y)))))
active(sieve(cons(X, Y))) → mark(cons(X, filter(X, sieve(Y))))
mark(primes) → active(primes)
mark(sieve(X)) → active(sieve(mark(X)))
mark(from(X)) → active(from(mark(X)))
mark(s(X)) → active(s(mark(X)))
mark(0) → active(0)
mark(cons(X1, X2)) → active(cons(mark(X1), X2))
mark(head(X)) → active(head(mark(X)))
mark(tail(X)) → active(tail(mark(X)))
mark(if(X1, X2, X3)) → active(if(mark(X1), X2, X3))
mark(true) → active(true)
mark(false) → active(false)
mark(filter(X1, X2)) → active(filter(mark(X1), mark(X2)))
mark(divides(X1, X2)) → active(divides(mark(X1), mark(X2)))
sieve(mark(X)) → sieve(X)
sieve(active(X)) → sieve(X)
from(mark(X)) → from(X)
from(active(X)) → from(X)
s(mark(X)) → s(X)
s(active(X)) → s(X)
cons(mark(X1), X2) → cons(X1, X2)
cons(X1, mark(X2)) → cons(X1, X2)
cons(active(X1), X2) → cons(X1, X2)
cons(X1, active(X2)) → cons(X1, X2)
head(mark(X)) → head(X)
head(active(X)) → head(X)
tail(mark(X)) → tail(X)
tail(active(X)) → tail(X)
if(mark(X1), X2, X3) → if(X1, X2, X3)
if(X1, mark(X2), X3) → if(X1, X2, X3)
if(X1, X2, mark(X3)) → if(X1, X2, X3)
if(active(X1), X2, X3) → if(X1, X2, X3)
if(X1, active(X2), X3) → if(X1, X2, X3)
if(X1, X2, active(X3)) → if(X1, X2, X3)
filter(mark(X1), X2) → filter(X1, X2)
filter(X1, mark(X2)) → filter(X1, X2)
filter(active(X1), X2) → filter(X1, X2)
filter(X1, active(X2)) → filter(X1, X2)
divides(mark(X1), X2) → divides(X1, X2)
divides(X1, mark(X2)) → divides(X1, X2)
divides(active(X1), X2) → divides(X1, X2)
divides(X1, active(X2)) → divides(X1, X2)

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
We can use the usable rules and reduction pair processor [15] with the Ce-compatible extension of the polynomial order that maps every function symbol to the sum of its argument. Then, we can delete all non-usable rules [17] from R.

↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
          ↳ QDP
            ↳ UsableRulesProof
QDP
                ↳ QDPSizeChangeProof
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

DIVIDES(active(X1), X2) → DIVIDES(X1, X2)
DIVIDES(X1, active(X2)) → DIVIDES(X1, X2)
DIVIDES(mark(X1), X2) → DIVIDES(X1, X2)
DIVIDES(X1, mark(X2)) → DIVIDES(X1, X2)

R is empty.
Q is empty.
We have to consider all minimal (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
          ↳ QDP
QDP
            ↳ UsableRulesProof
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

FILTER(mark(X1), X2) → FILTER(X1, X2)
FILTER(X1, active(X2)) → FILTER(X1, X2)
FILTER(active(X1), X2) → FILTER(X1, X2)
FILTER(X1, mark(X2)) → FILTER(X1, X2)

The TRS R consists of the following rules:

active(primes) → mark(sieve(from(s(s(0)))))
active(from(X)) → mark(cons(X, from(s(X))))
active(head(cons(X, Y))) → mark(X)
active(tail(cons(X, Y))) → mark(Y)
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(filter(s(s(X)), cons(Y, Z))) → mark(if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y)))))
active(sieve(cons(X, Y))) → mark(cons(X, filter(X, sieve(Y))))
mark(primes) → active(primes)
mark(sieve(X)) → active(sieve(mark(X)))
mark(from(X)) → active(from(mark(X)))
mark(s(X)) → active(s(mark(X)))
mark(0) → active(0)
mark(cons(X1, X2)) → active(cons(mark(X1), X2))
mark(head(X)) → active(head(mark(X)))
mark(tail(X)) → active(tail(mark(X)))
mark(if(X1, X2, X3)) → active(if(mark(X1), X2, X3))
mark(true) → active(true)
mark(false) → active(false)
mark(filter(X1, X2)) → active(filter(mark(X1), mark(X2)))
mark(divides(X1, X2)) → active(divides(mark(X1), mark(X2)))
sieve(mark(X)) → sieve(X)
sieve(active(X)) → sieve(X)
from(mark(X)) → from(X)
from(active(X)) → from(X)
s(mark(X)) → s(X)
s(active(X)) → s(X)
cons(mark(X1), X2) → cons(X1, X2)
cons(X1, mark(X2)) → cons(X1, X2)
cons(active(X1), X2) → cons(X1, X2)
cons(X1, active(X2)) → cons(X1, X2)
head(mark(X)) → head(X)
head(active(X)) → head(X)
tail(mark(X)) → tail(X)
tail(active(X)) → tail(X)
if(mark(X1), X2, X3) → if(X1, X2, X3)
if(X1, mark(X2), X3) → if(X1, X2, X3)
if(X1, X2, mark(X3)) → if(X1, X2, X3)
if(active(X1), X2, X3) → if(X1, X2, X3)
if(X1, active(X2), X3) → if(X1, X2, X3)
if(X1, X2, active(X3)) → if(X1, X2, X3)
filter(mark(X1), X2) → filter(X1, X2)
filter(X1, mark(X2)) → filter(X1, X2)
filter(active(X1), X2) → filter(X1, X2)
filter(X1, active(X2)) → filter(X1, X2)
divides(mark(X1), X2) → divides(X1, X2)
divides(X1, mark(X2)) → divides(X1, X2)
divides(active(X1), X2) → divides(X1, X2)
divides(X1, active(X2)) → divides(X1, X2)

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
We can use the usable rules and reduction pair processor [15] with the Ce-compatible extension of the polynomial order that maps every function symbol to the sum of its argument. Then, we can delete all non-usable rules [17] from R.

↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
          ↳ QDP
          ↳ QDP
            ↳ UsableRulesProof
QDP
                ↳ QDPSizeChangeProof
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

FILTER(mark(X1), X2) → FILTER(X1, X2)
FILTER(X1, active(X2)) → FILTER(X1, X2)
FILTER(active(X1), X2) → FILTER(X1, X2)
FILTER(X1, mark(X2)) → FILTER(X1, X2)

R is empty.
Q is empty.
We have to consider all minimal (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
          ↳ QDP
          ↳ QDP
QDP
            ↳ UsableRulesProof
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

IF(X1, mark(X2), X3) → IF(X1, X2, X3)
IF(X1, X2, active(X3)) → IF(X1, X2, X3)
IF(X1, active(X2), X3) → IF(X1, X2, X3)
IF(X1, X2, mark(X3)) → IF(X1, X2, X3)
IF(active(X1), X2, X3) → IF(X1, X2, X3)
IF(mark(X1), X2, X3) → IF(X1, X2, X3)

The TRS R consists of the following rules:

active(primes) → mark(sieve(from(s(s(0)))))
active(from(X)) → mark(cons(X, from(s(X))))
active(head(cons(X, Y))) → mark(X)
active(tail(cons(X, Y))) → mark(Y)
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(filter(s(s(X)), cons(Y, Z))) → mark(if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y)))))
active(sieve(cons(X, Y))) → mark(cons(X, filter(X, sieve(Y))))
mark(primes) → active(primes)
mark(sieve(X)) → active(sieve(mark(X)))
mark(from(X)) → active(from(mark(X)))
mark(s(X)) → active(s(mark(X)))
mark(0) → active(0)
mark(cons(X1, X2)) → active(cons(mark(X1), X2))
mark(head(X)) → active(head(mark(X)))
mark(tail(X)) → active(tail(mark(X)))
mark(if(X1, X2, X3)) → active(if(mark(X1), X2, X3))
mark(true) → active(true)
mark(false) → active(false)
mark(filter(X1, X2)) → active(filter(mark(X1), mark(X2)))
mark(divides(X1, X2)) → active(divides(mark(X1), mark(X2)))
sieve(mark(X)) → sieve(X)
sieve(active(X)) → sieve(X)
from(mark(X)) → from(X)
from(active(X)) → from(X)
s(mark(X)) → s(X)
s(active(X)) → s(X)
cons(mark(X1), X2) → cons(X1, X2)
cons(X1, mark(X2)) → cons(X1, X2)
cons(active(X1), X2) → cons(X1, X2)
cons(X1, active(X2)) → cons(X1, X2)
head(mark(X)) → head(X)
head(active(X)) → head(X)
tail(mark(X)) → tail(X)
tail(active(X)) → tail(X)
if(mark(X1), X2, X3) → if(X1, X2, X3)
if(X1, mark(X2), X3) → if(X1, X2, X3)
if(X1, X2, mark(X3)) → if(X1, X2, X3)
if(active(X1), X2, X3) → if(X1, X2, X3)
if(X1, active(X2), X3) → if(X1, X2, X3)
if(X1, X2, active(X3)) → if(X1, X2, X3)
filter(mark(X1), X2) → filter(X1, X2)
filter(X1, mark(X2)) → filter(X1, X2)
filter(active(X1), X2) → filter(X1, X2)
filter(X1, active(X2)) → filter(X1, X2)
divides(mark(X1), X2) → divides(X1, X2)
divides(X1, mark(X2)) → divides(X1, X2)
divides(active(X1), X2) → divides(X1, X2)
divides(X1, active(X2)) → divides(X1, X2)

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
We can use the usable rules and reduction pair processor [15] with the Ce-compatible extension of the polynomial order that maps every function symbol to the sum of its argument. Then, we can delete all non-usable rules [17] from R.

↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
          ↳ QDP
          ↳ QDP
          ↳ QDP
            ↳ UsableRulesProof
QDP
                ↳ QDPSizeChangeProof
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

IF(X1, mark(X2), X3) → IF(X1, X2, X3)
IF(X1, X2, active(X3)) → IF(X1, X2, X3)
IF(X1, active(X2), X3) → IF(X1, X2, X3)
IF(X1, X2, mark(X3)) → IF(X1, X2, X3)
IF(mark(X1), X2, X3) → IF(X1, X2, X3)
IF(active(X1), X2, X3) → IF(X1, X2, X3)

R is empty.
Q is empty.
We have to consider all minimal (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
          ↳ QDP
          ↳ QDP
          ↳ QDP
QDP
            ↳ UsableRulesProof
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

TAIL(active(X)) → TAIL(X)
TAIL(mark(X)) → TAIL(X)

The TRS R consists of the following rules:

active(primes) → mark(sieve(from(s(s(0)))))
active(from(X)) → mark(cons(X, from(s(X))))
active(head(cons(X, Y))) → mark(X)
active(tail(cons(X, Y))) → mark(Y)
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(filter(s(s(X)), cons(Y, Z))) → mark(if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y)))))
active(sieve(cons(X, Y))) → mark(cons(X, filter(X, sieve(Y))))
mark(primes) → active(primes)
mark(sieve(X)) → active(sieve(mark(X)))
mark(from(X)) → active(from(mark(X)))
mark(s(X)) → active(s(mark(X)))
mark(0) → active(0)
mark(cons(X1, X2)) → active(cons(mark(X1), X2))
mark(head(X)) → active(head(mark(X)))
mark(tail(X)) → active(tail(mark(X)))
mark(if(X1, X2, X3)) → active(if(mark(X1), X2, X3))
mark(true) → active(true)
mark(false) → active(false)
mark(filter(X1, X2)) → active(filter(mark(X1), mark(X2)))
mark(divides(X1, X2)) → active(divides(mark(X1), mark(X2)))
sieve(mark(X)) → sieve(X)
sieve(active(X)) → sieve(X)
from(mark(X)) → from(X)
from(active(X)) → from(X)
s(mark(X)) → s(X)
s(active(X)) → s(X)
cons(mark(X1), X2) → cons(X1, X2)
cons(X1, mark(X2)) → cons(X1, X2)
cons(active(X1), X2) → cons(X1, X2)
cons(X1, active(X2)) → cons(X1, X2)
head(mark(X)) → head(X)
head(active(X)) → head(X)
tail(mark(X)) → tail(X)
tail(active(X)) → tail(X)
if(mark(X1), X2, X3) → if(X1, X2, X3)
if(X1, mark(X2), X3) → if(X1, X2, X3)
if(X1, X2, mark(X3)) → if(X1, X2, X3)
if(active(X1), X2, X3) → if(X1, X2, X3)
if(X1, active(X2), X3) → if(X1, X2, X3)
if(X1, X2, active(X3)) → if(X1, X2, X3)
filter(mark(X1), X2) → filter(X1, X2)
filter(X1, mark(X2)) → filter(X1, X2)
filter(active(X1), X2) → filter(X1, X2)
filter(X1, active(X2)) → filter(X1, X2)
divides(mark(X1), X2) → divides(X1, X2)
divides(X1, mark(X2)) → divides(X1, X2)
divides(active(X1), X2) → divides(X1, X2)
divides(X1, active(X2)) → divides(X1, X2)

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
We can use the usable rules and reduction pair processor [15] with the Ce-compatible extension of the polynomial order that maps every function symbol to the sum of its argument. Then, we can delete all non-usable rules [17] from R.

↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
            ↳ UsableRulesProof
QDP
                ↳ QDPSizeChangeProof
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

TAIL(active(X)) → TAIL(X)
TAIL(mark(X)) → TAIL(X)

R is empty.
Q is empty.
We have to consider all minimal (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
QDP
            ↳ UsableRulesProof
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

HEAD(mark(X)) → HEAD(X)
HEAD(active(X)) → HEAD(X)

The TRS R consists of the following rules:

active(primes) → mark(sieve(from(s(s(0)))))
active(from(X)) → mark(cons(X, from(s(X))))
active(head(cons(X, Y))) → mark(X)
active(tail(cons(X, Y))) → mark(Y)
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(filter(s(s(X)), cons(Y, Z))) → mark(if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y)))))
active(sieve(cons(X, Y))) → mark(cons(X, filter(X, sieve(Y))))
mark(primes) → active(primes)
mark(sieve(X)) → active(sieve(mark(X)))
mark(from(X)) → active(from(mark(X)))
mark(s(X)) → active(s(mark(X)))
mark(0) → active(0)
mark(cons(X1, X2)) → active(cons(mark(X1), X2))
mark(head(X)) → active(head(mark(X)))
mark(tail(X)) → active(tail(mark(X)))
mark(if(X1, X2, X3)) → active(if(mark(X1), X2, X3))
mark(true) → active(true)
mark(false) → active(false)
mark(filter(X1, X2)) → active(filter(mark(X1), mark(X2)))
mark(divides(X1, X2)) → active(divides(mark(X1), mark(X2)))
sieve(mark(X)) → sieve(X)
sieve(active(X)) → sieve(X)
from(mark(X)) → from(X)
from(active(X)) → from(X)
s(mark(X)) → s(X)
s(active(X)) → s(X)
cons(mark(X1), X2) → cons(X1, X2)
cons(X1, mark(X2)) → cons(X1, X2)
cons(active(X1), X2) → cons(X1, X2)
cons(X1, active(X2)) → cons(X1, X2)
head(mark(X)) → head(X)
head(active(X)) → head(X)
tail(mark(X)) → tail(X)
tail(active(X)) → tail(X)
if(mark(X1), X2, X3) → if(X1, X2, X3)
if(X1, mark(X2), X3) → if(X1, X2, X3)
if(X1, X2, mark(X3)) → if(X1, X2, X3)
if(active(X1), X2, X3) → if(X1, X2, X3)
if(X1, active(X2), X3) → if(X1, X2, X3)
if(X1, X2, active(X3)) → if(X1, X2, X3)
filter(mark(X1), X2) → filter(X1, X2)
filter(X1, mark(X2)) → filter(X1, X2)
filter(active(X1), X2) → filter(X1, X2)
filter(X1, active(X2)) → filter(X1, X2)
divides(mark(X1), X2) → divides(X1, X2)
divides(X1, mark(X2)) → divides(X1, X2)
divides(active(X1), X2) → divides(X1, X2)
divides(X1, active(X2)) → divides(X1, X2)

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
We can use the usable rules and reduction pair processor [15] with the Ce-compatible extension of the polynomial order that maps every function symbol to the sum of its argument. Then, we can delete all non-usable rules [17] from R.

↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
            ↳ UsableRulesProof
QDP
                ↳ QDPSizeChangeProof
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

HEAD(mark(X)) → HEAD(X)
HEAD(active(X)) → HEAD(X)

R is empty.
Q is empty.
We have to consider all minimal (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
QDP
            ↳ UsableRulesProof
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

CONS(X1, active(X2)) → CONS(X1, X2)
CONS(mark(X1), X2) → CONS(X1, X2)
CONS(active(X1), X2) → CONS(X1, X2)
CONS(X1, mark(X2)) → CONS(X1, X2)

The TRS R consists of the following rules:

active(primes) → mark(sieve(from(s(s(0)))))
active(from(X)) → mark(cons(X, from(s(X))))
active(head(cons(X, Y))) → mark(X)
active(tail(cons(X, Y))) → mark(Y)
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(filter(s(s(X)), cons(Y, Z))) → mark(if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y)))))
active(sieve(cons(X, Y))) → mark(cons(X, filter(X, sieve(Y))))
mark(primes) → active(primes)
mark(sieve(X)) → active(sieve(mark(X)))
mark(from(X)) → active(from(mark(X)))
mark(s(X)) → active(s(mark(X)))
mark(0) → active(0)
mark(cons(X1, X2)) → active(cons(mark(X1), X2))
mark(head(X)) → active(head(mark(X)))
mark(tail(X)) → active(tail(mark(X)))
mark(if(X1, X2, X3)) → active(if(mark(X1), X2, X3))
mark(true) → active(true)
mark(false) → active(false)
mark(filter(X1, X2)) → active(filter(mark(X1), mark(X2)))
mark(divides(X1, X2)) → active(divides(mark(X1), mark(X2)))
sieve(mark(X)) → sieve(X)
sieve(active(X)) → sieve(X)
from(mark(X)) → from(X)
from(active(X)) → from(X)
s(mark(X)) → s(X)
s(active(X)) → s(X)
cons(mark(X1), X2) → cons(X1, X2)
cons(X1, mark(X2)) → cons(X1, X2)
cons(active(X1), X2) → cons(X1, X2)
cons(X1, active(X2)) → cons(X1, X2)
head(mark(X)) → head(X)
head(active(X)) → head(X)
tail(mark(X)) → tail(X)
tail(active(X)) → tail(X)
if(mark(X1), X2, X3) → if(X1, X2, X3)
if(X1, mark(X2), X3) → if(X1, X2, X3)
if(X1, X2, mark(X3)) → if(X1, X2, X3)
if(active(X1), X2, X3) → if(X1, X2, X3)
if(X1, active(X2), X3) → if(X1, X2, X3)
if(X1, X2, active(X3)) → if(X1, X2, X3)
filter(mark(X1), X2) → filter(X1, X2)
filter(X1, mark(X2)) → filter(X1, X2)
filter(active(X1), X2) → filter(X1, X2)
filter(X1, active(X2)) → filter(X1, X2)
divides(mark(X1), X2) → divides(X1, X2)
divides(X1, mark(X2)) → divides(X1, X2)
divides(active(X1), X2) → divides(X1, X2)
divides(X1, active(X2)) → divides(X1, X2)

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
We can use the usable rules and reduction pair processor [15] with the Ce-compatible extension of the polynomial order that maps every function symbol to the sum of its argument. Then, we can delete all non-usable rules [17] from R.

↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
            ↳ UsableRulesProof
QDP
                ↳ QDPSizeChangeProof
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

CONS(mark(X1), X2) → CONS(X1, X2)
CONS(X1, active(X2)) → CONS(X1, X2)
CONS(X1, mark(X2)) → CONS(X1, X2)
CONS(active(X1), X2) → CONS(X1, X2)

R is empty.
Q is empty.
We have to consider all minimal (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
QDP
            ↳ UsableRulesProof
          ↳ QDP
          ↳ QDP
          ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

S(mark(X)) → S(X)
S(active(X)) → S(X)

The TRS R consists of the following rules:

active(primes) → mark(sieve(from(s(s(0)))))
active(from(X)) → mark(cons(X, from(s(X))))
active(head(cons(X, Y))) → mark(X)
active(tail(cons(X, Y))) → mark(Y)
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(filter(s(s(X)), cons(Y, Z))) → mark(if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y)))))
active(sieve(cons(X, Y))) → mark(cons(X, filter(X, sieve(Y))))
mark(primes) → active(primes)
mark(sieve(X)) → active(sieve(mark(X)))
mark(from(X)) → active(from(mark(X)))
mark(s(X)) → active(s(mark(X)))
mark(0) → active(0)
mark(cons(X1, X2)) → active(cons(mark(X1), X2))
mark(head(X)) → active(head(mark(X)))
mark(tail(X)) → active(tail(mark(X)))
mark(if(X1, X2, X3)) → active(if(mark(X1), X2, X3))
mark(true) → active(true)
mark(false) → active(false)
mark(filter(X1, X2)) → active(filter(mark(X1), mark(X2)))
mark(divides(X1, X2)) → active(divides(mark(X1), mark(X2)))
sieve(mark(X)) → sieve(X)
sieve(active(X)) → sieve(X)
from(mark(X)) → from(X)
from(active(X)) → from(X)
s(mark(X)) → s(X)
s(active(X)) → s(X)
cons(mark(X1), X2) → cons(X1, X2)
cons(X1, mark(X2)) → cons(X1, X2)
cons(active(X1), X2) → cons(X1, X2)
cons(X1, active(X2)) → cons(X1, X2)
head(mark(X)) → head(X)
head(active(X)) → head(X)
tail(mark(X)) → tail(X)
tail(active(X)) → tail(X)
if(mark(X1), X2, X3) → if(X1, X2, X3)
if(X1, mark(X2), X3) → if(X1, X2, X3)
if(X1, X2, mark(X3)) → if(X1, X2, X3)
if(active(X1), X2, X3) → if(X1, X2, X3)
if(X1, active(X2), X3) → if(X1, X2, X3)
if(X1, X2, active(X3)) → if(X1, X2, X3)
filter(mark(X1), X2) → filter(X1, X2)
filter(X1, mark(X2)) → filter(X1, X2)
filter(active(X1), X2) → filter(X1, X2)
filter(X1, active(X2)) → filter(X1, X2)
divides(mark(X1), X2) → divides(X1, X2)
divides(X1, mark(X2)) → divides(X1, X2)
divides(active(X1), X2) → divides(X1, X2)
divides(X1, active(X2)) → divides(X1, X2)

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
We can use the usable rules and reduction pair processor [15] with the Ce-compatible extension of the polynomial order that maps every function symbol to the sum of its argument. Then, we can delete all non-usable rules [17] from R.

↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
            ↳ UsableRulesProof
QDP
                ↳ QDPSizeChangeProof
          ↳ QDP
          ↳ QDP
          ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

S(active(X)) → S(X)
S(mark(X)) → S(X)

R is empty.
Q is empty.
We have to consider all minimal (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
QDP
            ↳ UsableRulesProof
          ↳ QDP
          ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

FROM(mark(X)) → FROM(X)
FROM(active(X)) → FROM(X)

The TRS R consists of the following rules:

active(primes) → mark(sieve(from(s(s(0)))))
active(from(X)) → mark(cons(X, from(s(X))))
active(head(cons(X, Y))) → mark(X)
active(tail(cons(X, Y))) → mark(Y)
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(filter(s(s(X)), cons(Y, Z))) → mark(if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y)))))
active(sieve(cons(X, Y))) → mark(cons(X, filter(X, sieve(Y))))
mark(primes) → active(primes)
mark(sieve(X)) → active(sieve(mark(X)))
mark(from(X)) → active(from(mark(X)))
mark(s(X)) → active(s(mark(X)))
mark(0) → active(0)
mark(cons(X1, X2)) → active(cons(mark(X1), X2))
mark(head(X)) → active(head(mark(X)))
mark(tail(X)) → active(tail(mark(X)))
mark(if(X1, X2, X3)) → active(if(mark(X1), X2, X3))
mark(true) → active(true)
mark(false) → active(false)
mark(filter(X1, X2)) → active(filter(mark(X1), mark(X2)))
mark(divides(X1, X2)) → active(divides(mark(X1), mark(X2)))
sieve(mark(X)) → sieve(X)
sieve(active(X)) → sieve(X)
from(mark(X)) → from(X)
from(active(X)) → from(X)
s(mark(X)) → s(X)
s(active(X)) → s(X)
cons(mark(X1), X2) → cons(X1, X2)
cons(X1, mark(X2)) → cons(X1, X2)
cons(active(X1), X2) → cons(X1, X2)
cons(X1, active(X2)) → cons(X1, X2)
head(mark(X)) → head(X)
head(active(X)) → head(X)
tail(mark(X)) → tail(X)
tail(active(X)) → tail(X)
if(mark(X1), X2, X3) → if(X1, X2, X3)
if(X1, mark(X2), X3) → if(X1, X2, X3)
if(X1, X2, mark(X3)) → if(X1, X2, X3)
if(active(X1), X2, X3) → if(X1, X2, X3)
if(X1, active(X2), X3) → if(X1, X2, X3)
if(X1, X2, active(X3)) → if(X1, X2, X3)
filter(mark(X1), X2) → filter(X1, X2)
filter(X1, mark(X2)) → filter(X1, X2)
filter(active(X1), X2) → filter(X1, X2)
filter(X1, active(X2)) → filter(X1, X2)
divides(mark(X1), X2) → divides(X1, X2)
divides(X1, mark(X2)) → divides(X1, X2)
divides(active(X1), X2) → divides(X1, X2)
divides(X1, active(X2)) → divides(X1, X2)

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
We can use the usable rules and reduction pair processor [15] with the Ce-compatible extension of the polynomial order that maps every function symbol to the sum of its argument. Then, we can delete all non-usable rules [17] from R.

↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
            ↳ UsableRulesProof
QDP
                ↳ QDPSizeChangeProof
          ↳ QDP
          ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

FROM(mark(X)) → FROM(X)
FROM(active(X)) → FROM(X)

R is empty.
Q is empty.
We have to consider all minimal (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
QDP
            ↳ UsableRulesProof
          ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

SIEVE(active(X)) → SIEVE(X)
SIEVE(mark(X)) → SIEVE(X)

The TRS R consists of the following rules:

active(primes) → mark(sieve(from(s(s(0)))))
active(from(X)) → mark(cons(X, from(s(X))))
active(head(cons(X, Y))) → mark(X)
active(tail(cons(X, Y))) → mark(Y)
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(filter(s(s(X)), cons(Y, Z))) → mark(if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y)))))
active(sieve(cons(X, Y))) → mark(cons(X, filter(X, sieve(Y))))
mark(primes) → active(primes)
mark(sieve(X)) → active(sieve(mark(X)))
mark(from(X)) → active(from(mark(X)))
mark(s(X)) → active(s(mark(X)))
mark(0) → active(0)
mark(cons(X1, X2)) → active(cons(mark(X1), X2))
mark(head(X)) → active(head(mark(X)))
mark(tail(X)) → active(tail(mark(X)))
mark(if(X1, X2, X3)) → active(if(mark(X1), X2, X3))
mark(true) → active(true)
mark(false) → active(false)
mark(filter(X1, X2)) → active(filter(mark(X1), mark(X2)))
mark(divides(X1, X2)) → active(divides(mark(X1), mark(X2)))
sieve(mark(X)) → sieve(X)
sieve(active(X)) → sieve(X)
from(mark(X)) → from(X)
from(active(X)) → from(X)
s(mark(X)) → s(X)
s(active(X)) → s(X)
cons(mark(X1), X2) → cons(X1, X2)
cons(X1, mark(X2)) → cons(X1, X2)
cons(active(X1), X2) → cons(X1, X2)
cons(X1, active(X2)) → cons(X1, X2)
head(mark(X)) → head(X)
head(active(X)) → head(X)
tail(mark(X)) → tail(X)
tail(active(X)) → tail(X)
if(mark(X1), X2, X3) → if(X1, X2, X3)
if(X1, mark(X2), X3) → if(X1, X2, X3)
if(X1, X2, mark(X3)) → if(X1, X2, X3)
if(active(X1), X2, X3) → if(X1, X2, X3)
if(X1, active(X2), X3) → if(X1, X2, X3)
if(X1, X2, active(X3)) → if(X1, X2, X3)
filter(mark(X1), X2) → filter(X1, X2)
filter(X1, mark(X2)) → filter(X1, X2)
filter(active(X1), X2) → filter(X1, X2)
filter(X1, active(X2)) → filter(X1, X2)
divides(mark(X1), X2) → divides(X1, X2)
divides(X1, mark(X2)) → divides(X1, X2)
divides(active(X1), X2) → divides(X1, X2)
divides(X1, active(X2)) → divides(X1, X2)

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
We can use the usable rules and reduction pair processor [15] with the Ce-compatible extension of the polynomial order that maps every function symbol to the sum of its argument. Then, we can delete all non-usable rules [17] from R.

↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
            ↳ UsableRulesProof
QDP
                ↳ QDPSizeChangeProof
          ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

SIEVE(active(X)) → SIEVE(X)
SIEVE(mark(X)) → SIEVE(X)

R is empty.
Q is empty.
We have to consider all minimal (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
QDP
            ↳ QDPOrderProof

Q DP problem:
The TRS P consists of the following rules:

MARK(primes) → ACTIVE(primes)
MARK(filter(X1, X2)) → MARK(X2)
MARK(s(X)) → MARK(X)
ACTIVE(if(false, X, Y)) → MARK(Y)
ACTIVE(sieve(cons(X, Y))) → MARK(cons(X, filter(X, sieve(Y))))
MARK(head(X)) → MARK(X)
MARK(tail(X)) → MARK(X)
MARK(cons(X1, X2)) → MARK(X1)
ACTIVE(filter(s(s(X)), cons(Y, Z))) → MARK(if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y)))))
MARK(sieve(X)) → ACTIVE(sieve(mark(X)))
MARK(s(X)) → ACTIVE(s(mark(X)))
MARK(if(X1, X2, X3)) → MARK(X1)
ACTIVE(from(X)) → MARK(cons(X, from(s(X))))
MARK(from(X)) → MARK(X)
MARK(cons(X1, X2)) → ACTIVE(cons(mark(X1), X2))
MARK(divides(X1, X2)) → MARK(X2)
MARK(divides(X1, X2)) → ACTIVE(divides(mark(X1), mark(X2)))
MARK(if(X1, X2, X3)) → ACTIVE(if(mark(X1), X2, X3))
MARK(filter(X1, X2)) → ACTIVE(filter(mark(X1), mark(X2)))
MARK(head(X)) → ACTIVE(head(mark(X)))
MARK(tail(X)) → ACTIVE(tail(mark(X)))
ACTIVE(primes) → MARK(sieve(from(s(s(0)))))
MARK(filter(X1, X2)) → MARK(X1)
MARK(from(X)) → ACTIVE(from(mark(X)))
MARK(divides(X1, X2)) → MARK(X1)
ACTIVE(head(cons(X, Y))) → MARK(X)
MARK(sieve(X)) → MARK(X)
ACTIVE(if(true, X, Y)) → MARK(X)
ACTIVE(tail(cons(X, Y))) → MARK(Y)

The TRS R consists of the following rules:

active(primes) → mark(sieve(from(s(s(0)))))
active(from(X)) → mark(cons(X, from(s(X))))
active(head(cons(X, Y))) → mark(X)
active(tail(cons(X, Y))) → mark(Y)
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(filter(s(s(X)), cons(Y, Z))) → mark(if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y)))))
active(sieve(cons(X, Y))) → mark(cons(X, filter(X, sieve(Y))))
mark(primes) → active(primes)
mark(sieve(X)) → active(sieve(mark(X)))
mark(from(X)) → active(from(mark(X)))
mark(s(X)) → active(s(mark(X)))
mark(0) → active(0)
mark(cons(X1, X2)) → active(cons(mark(X1), X2))
mark(head(X)) → active(head(mark(X)))
mark(tail(X)) → active(tail(mark(X)))
mark(if(X1, X2, X3)) → active(if(mark(X1), X2, X3))
mark(true) → active(true)
mark(false) → active(false)
mark(filter(X1, X2)) → active(filter(mark(X1), mark(X2)))
mark(divides(X1, X2)) → active(divides(mark(X1), mark(X2)))
sieve(mark(X)) → sieve(X)
sieve(active(X)) → sieve(X)
from(mark(X)) → from(X)
from(active(X)) → from(X)
s(mark(X)) → s(X)
s(active(X)) → s(X)
cons(mark(X1), X2) → cons(X1, X2)
cons(X1, mark(X2)) → cons(X1, X2)
cons(active(X1), X2) → cons(X1, X2)
cons(X1, active(X2)) → cons(X1, X2)
head(mark(X)) → head(X)
head(active(X)) → head(X)
tail(mark(X)) → tail(X)
tail(active(X)) → tail(X)
if(mark(X1), X2, X3) → if(X1, X2, X3)
if(X1, mark(X2), X3) → if(X1, X2, X3)
if(X1, X2, mark(X3)) → if(X1, X2, X3)
if(active(X1), X2, X3) → if(X1, X2, X3)
if(X1, active(X2), X3) → if(X1, X2, X3)
if(X1, X2, active(X3)) → if(X1, X2, X3)
filter(mark(X1), X2) → filter(X1, X2)
filter(X1, mark(X2)) → filter(X1, X2)
filter(active(X1), X2) → filter(X1, X2)
filter(X1, active(X2)) → filter(X1, X2)
divides(mark(X1), X2) → divides(X1, X2)
divides(X1, mark(X2)) → divides(X1, X2)
divides(active(X1), X2) → divides(X1, X2)
divides(X1, active(X2)) → divides(X1, X2)

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
We use the reduction pair processor [15].


The following pairs can be oriented strictly and are deleted.


MARK(s(X)) → ACTIVE(s(mark(X)))
MARK(cons(X1, X2)) → ACTIVE(cons(mark(X1), X2))
MARK(divides(X1, X2)) → ACTIVE(divides(mark(X1), mark(X2)))
The remaining pairs can at least be oriented weakly.

MARK(primes) → ACTIVE(primes)
MARK(filter(X1, X2)) → MARK(X2)
MARK(s(X)) → MARK(X)
ACTIVE(if(false, X, Y)) → MARK(Y)
ACTIVE(sieve(cons(X, Y))) → MARK(cons(X, filter(X, sieve(Y))))
MARK(head(X)) → MARK(X)
MARK(tail(X)) → MARK(X)
MARK(cons(X1, X2)) → MARK(X1)
ACTIVE(filter(s(s(X)), cons(Y, Z))) → MARK(if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y)))))
MARK(sieve(X)) → ACTIVE(sieve(mark(X)))
MARK(if(X1, X2, X3)) → MARK(X1)
ACTIVE(from(X)) → MARK(cons(X, from(s(X))))
MARK(from(X)) → MARK(X)
MARK(divides(X1, X2)) → MARK(X2)
MARK(if(X1, X2, X3)) → ACTIVE(if(mark(X1), X2, X3))
MARK(filter(X1, X2)) → ACTIVE(filter(mark(X1), mark(X2)))
MARK(head(X)) → ACTIVE(head(mark(X)))
MARK(tail(X)) → ACTIVE(tail(mark(X)))
ACTIVE(primes) → MARK(sieve(from(s(s(0)))))
MARK(filter(X1, X2)) → MARK(X1)
MARK(from(X)) → ACTIVE(from(mark(X)))
MARK(divides(X1, X2)) → MARK(X1)
ACTIVE(head(cons(X, Y))) → MARK(X)
MARK(sieve(X)) → MARK(X)
ACTIVE(if(true, X, Y)) → MARK(X)
ACTIVE(tail(cons(X, Y))) → MARK(Y)
Used ordering: Polynomial interpretation [25]:

POL(0) = 0   
POL(ACTIVE(x1)) = x1   
POL(MARK(x1)) = 1   
POL(active(x1)) = 0   
POL(cons(x1, x2)) = 0   
POL(divides(x1, x2)) = 0   
POL(false) = 0   
POL(filter(x1, x2)) = 1   
POL(from(x1)) = 1   
POL(head(x1)) = 1   
POL(if(x1, x2, x3)) = 1   
POL(mark(x1)) = 0   
POL(primes) = 1   
POL(s(x1)) = 0   
POL(sieve(x1)) = 1   
POL(tail(x1)) = 1   
POL(true) = 0   

The following usable rules [17] were oriented:

head(active(X)) → head(X)
head(mark(X)) → head(X)
tail(mark(X)) → tail(X)
tail(active(X)) → tail(X)
if(mark(X1), X2, X3) → if(X1, X2, X3)
if(X1, X2, active(X3)) → if(X1, X2, X3)
if(X1, mark(X2), X3) → if(X1, X2, X3)
if(X1, X2, mark(X3)) → if(X1, X2, X3)
if(X1, active(X2), X3) → if(X1, X2, X3)
if(active(X1), X2, X3) → if(X1, X2, X3)
from(active(X)) → from(X)
from(mark(X)) → from(X)
s(active(X)) → s(X)
s(mark(X)) → s(X)
cons(X1, active(X2)) → cons(X1, X2)
cons(mark(X1), X2) → cons(X1, X2)
cons(X1, mark(X2)) → cons(X1, X2)
cons(active(X1), X2) → cons(X1, X2)
filter(active(X1), X2) → filter(X1, X2)
filter(mark(X1), X2) → filter(X1, X2)
filter(X1, mark(X2)) → filter(X1, X2)
filter(X1, active(X2)) → filter(X1, X2)
divides(mark(X1), X2) → divides(X1, X2)
divides(active(X1), X2) → divides(X1, X2)
divides(X1, mark(X2)) → divides(X1, X2)
divides(X1, active(X2)) → divides(X1, X2)
sieve(mark(X)) → sieve(X)
sieve(active(X)) → sieve(X)



↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
            ↳ QDPOrderProof
QDP
                ↳ Narrowing

Q DP problem:
The TRS P consists of the following rules:

MARK(primes) → ACTIVE(primes)
MARK(s(X)) → MARK(X)
MARK(filter(X1, X2)) → MARK(X2)
ACTIVE(sieve(cons(X, Y))) → MARK(cons(X, filter(X, sieve(Y))))
ACTIVE(if(false, X, Y)) → MARK(Y)
MARK(tail(X)) → MARK(X)
MARK(head(X)) → MARK(X)
MARK(cons(X1, X2)) → MARK(X1)
ACTIVE(filter(s(s(X)), cons(Y, Z))) → MARK(if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y)))))
MARK(sieve(X)) → ACTIVE(sieve(mark(X)))
MARK(if(X1, X2, X3)) → MARK(X1)
ACTIVE(from(X)) → MARK(cons(X, from(s(X))))
MARK(from(X)) → MARK(X)
MARK(divides(X1, X2)) → MARK(X2)
MARK(if(X1, X2, X3)) → ACTIVE(if(mark(X1), X2, X3))
MARK(filter(X1, X2)) → ACTIVE(filter(mark(X1), mark(X2)))
MARK(head(X)) → ACTIVE(head(mark(X)))
MARK(tail(X)) → ACTIVE(tail(mark(X)))
ACTIVE(primes) → MARK(sieve(from(s(s(0)))))
MARK(filter(X1, X2)) → MARK(X1)
MARK(from(X)) → ACTIVE(from(mark(X)))
MARK(divides(X1, X2)) → MARK(X1)
ACTIVE(head(cons(X, Y))) → MARK(X)
MARK(sieve(X)) → MARK(X)
ACTIVE(if(true, X, Y)) → MARK(X)
ACTIVE(tail(cons(X, Y))) → MARK(Y)

The TRS R consists of the following rules:

active(primes) → mark(sieve(from(s(s(0)))))
active(from(X)) → mark(cons(X, from(s(X))))
active(head(cons(X, Y))) → mark(X)
active(tail(cons(X, Y))) → mark(Y)
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(filter(s(s(X)), cons(Y, Z))) → mark(if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y)))))
active(sieve(cons(X, Y))) → mark(cons(X, filter(X, sieve(Y))))
mark(primes) → active(primes)
mark(sieve(X)) → active(sieve(mark(X)))
mark(from(X)) → active(from(mark(X)))
mark(s(X)) → active(s(mark(X)))
mark(0) → active(0)
mark(cons(X1, X2)) → active(cons(mark(X1), X2))
mark(head(X)) → active(head(mark(X)))
mark(tail(X)) → active(tail(mark(X)))
mark(if(X1, X2, X3)) → active(if(mark(X1), X2, X3))
mark(true) → active(true)
mark(false) → active(false)
mark(filter(X1, X2)) → active(filter(mark(X1), mark(X2)))
mark(divides(X1, X2)) → active(divides(mark(X1), mark(X2)))
sieve(mark(X)) → sieve(X)
sieve(active(X)) → sieve(X)
from(mark(X)) → from(X)
from(active(X)) → from(X)
s(mark(X)) → s(X)
s(active(X)) → s(X)
cons(mark(X1), X2) → cons(X1, X2)
cons(X1, mark(X2)) → cons(X1, X2)
cons(active(X1), X2) → cons(X1, X2)
cons(X1, active(X2)) → cons(X1, X2)
head(mark(X)) → head(X)
head(active(X)) → head(X)
tail(mark(X)) → tail(X)
tail(active(X)) → tail(X)
if(mark(X1), X2, X3) → if(X1, X2, X3)
if(X1, mark(X2), X3) → if(X1, X2, X3)
if(X1, X2, mark(X3)) → if(X1, X2, X3)
if(active(X1), X2, X3) → if(X1, X2, X3)
if(X1, active(X2), X3) → if(X1, X2, X3)
if(X1, X2, active(X3)) → if(X1, X2, X3)
filter(mark(X1), X2) → filter(X1, X2)
filter(X1, mark(X2)) → filter(X1, X2)
filter(active(X1), X2) → filter(X1, X2)
filter(X1, active(X2)) → filter(X1, X2)
divides(mark(X1), X2) → divides(X1, X2)
divides(X1, mark(X2)) → divides(X1, X2)
divides(active(X1), X2) → divides(X1, X2)
divides(X1, active(X2)) → divides(X1, X2)

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
By narrowing [15] the rule MARK(sieve(X)) → ACTIVE(sieve(mark(X))) at position [0] we obtained the following new rules:

MARK(sieve(sieve(x0))) → ACTIVE(sieve(active(sieve(mark(x0)))))
MARK(sieve(true)) → ACTIVE(sieve(active(true)))
MARK(sieve(primes)) → ACTIVE(sieve(active(primes)))
MARK(sieve(0)) → ACTIVE(sieve(active(0)))
MARK(sieve(false)) → ACTIVE(sieve(active(false)))
MARK(sieve(cons(x0, x1))) → ACTIVE(sieve(active(cons(mark(x0), x1))))
MARK(sieve(divides(x0, x1))) → ACTIVE(sieve(active(divides(mark(x0), mark(x1)))))
MARK(sieve(tail(x0))) → ACTIVE(sieve(active(tail(mark(x0)))))
MARK(sieve(filter(x0, x1))) → ACTIVE(sieve(active(filter(mark(x0), mark(x1)))))
MARK(sieve(from(x0))) → ACTIVE(sieve(active(from(mark(x0)))))
MARK(sieve(head(x0))) → ACTIVE(sieve(active(head(mark(x0)))))
MARK(sieve(if(x0, x1, x2))) → ACTIVE(sieve(active(if(mark(x0), x1, x2))))
MARK(sieve(x0)) → ACTIVE(sieve(x0))
MARK(sieve(s(x0))) → ACTIVE(sieve(active(s(mark(x0)))))



↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
            ↳ QDPOrderProof
              ↳ QDP
                ↳ Narrowing
QDP
                    ↳ Narrowing

Q DP problem:
The TRS P consists of the following rules:

MARK(sieve(sieve(x0))) → ACTIVE(sieve(active(sieve(mark(x0)))))
MARK(primes) → ACTIVE(primes)
MARK(filter(X1, X2)) → MARK(X2)
MARK(s(X)) → MARK(X)
ACTIVE(if(false, X, Y)) → MARK(Y)
ACTIVE(sieve(cons(X, Y))) → MARK(cons(X, filter(X, sieve(Y))))
MARK(head(X)) → MARK(X)
MARK(tail(X)) → MARK(X)
MARK(sieve(cons(x0, x1))) → ACTIVE(sieve(active(cons(mark(x0), x1))))
MARK(cons(X1, X2)) → MARK(X1)
MARK(sieve(tail(x0))) → ACTIVE(sieve(active(tail(mark(x0)))))
ACTIVE(filter(s(s(X)), cons(Y, Z))) → MARK(if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y)))))
MARK(sieve(filter(x0, x1))) → ACTIVE(sieve(active(filter(mark(x0), mark(x1)))))
MARK(sieve(from(x0))) → ACTIVE(sieve(active(from(mark(x0)))))
MARK(sieve(if(x0, x1, x2))) → ACTIVE(sieve(active(if(mark(x0), x1, x2))))
MARK(if(X1, X2, X3)) → MARK(X1)
MARK(sieve(x0)) → ACTIVE(sieve(x0))
ACTIVE(from(X)) → MARK(cons(X, from(s(X))))
MARK(sieve(s(x0))) → ACTIVE(sieve(active(s(mark(x0)))))
MARK(from(X)) → MARK(X)
MARK(sieve(true)) → ACTIVE(sieve(active(true)))
MARK(sieve(primes)) → ACTIVE(sieve(active(primes)))
MARK(divides(X1, X2)) → MARK(X2)
MARK(sieve(false)) → ACTIVE(sieve(active(false)))
MARK(sieve(0)) → ACTIVE(sieve(active(0)))
MARK(filter(X1, X2)) → ACTIVE(filter(mark(X1), mark(X2)))
MARK(if(X1, X2, X3)) → ACTIVE(if(mark(X1), X2, X3))
MARK(tail(X)) → ACTIVE(tail(mark(X)))
MARK(head(X)) → ACTIVE(head(mark(X)))
ACTIVE(primes) → MARK(sieve(from(s(s(0)))))
MARK(sieve(divides(x0, x1))) → ACTIVE(sieve(active(divides(mark(x0), mark(x1)))))
MARK(filter(X1, X2)) → MARK(X1)
MARK(from(X)) → ACTIVE(from(mark(X)))
MARK(sieve(head(x0))) → ACTIVE(sieve(active(head(mark(x0)))))
ACTIVE(head(cons(X, Y))) → MARK(X)
MARK(divides(X1, X2)) → MARK(X1)
MARK(sieve(X)) → MARK(X)
ACTIVE(if(true, X, Y)) → MARK(X)
ACTIVE(tail(cons(X, Y))) → MARK(Y)

The TRS R consists of the following rules:

active(primes) → mark(sieve(from(s(s(0)))))
active(from(X)) → mark(cons(X, from(s(X))))
active(head(cons(X, Y))) → mark(X)
active(tail(cons(X, Y))) → mark(Y)
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(filter(s(s(X)), cons(Y, Z))) → mark(if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y)))))
active(sieve(cons(X, Y))) → mark(cons(X, filter(X, sieve(Y))))
mark(primes) → active(primes)
mark(sieve(X)) → active(sieve(mark(X)))
mark(from(X)) → active(from(mark(X)))
mark(s(X)) → active(s(mark(X)))
mark(0) → active(0)
mark(cons(X1, X2)) → active(cons(mark(X1), X2))
mark(head(X)) → active(head(mark(X)))
mark(tail(X)) → active(tail(mark(X)))
mark(if(X1, X2, X3)) → active(if(mark(X1), X2, X3))
mark(true) → active(true)
mark(false) → active(false)
mark(filter(X1, X2)) → active(filter(mark(X1), mark(X2)))
mark(divides(X1, X2)) → active(divides(mark(X1), mark(X2)))
sieve(mark(X)) → sieve(X)
sieve(active(X)) → sieve(X)
from(mark(X)) → from(X)
from(active(X)) → from(X)
s(mark(X)) → s(X)
s(active(X)) → s(X)
cons(mark(X1), X2) → cons(X1, X2)
cons(X1, mark(X2)) → cons(X1, X2)
cons(active(X1), X2) → cons(X1, X2)
cons(X1, active(X2)) → cons(X1, X2)
head(mark(X)) → head(X)
head(active(X)) → head(X)
tail(mark(X)) → tail(X)
tail(active(X)) → tail(X)
if(mark(X1), X2, X3) → if(X1, X2, X3)
if(X1, mark(X2), X3) → if(X1, X2, X3)
if(X1, X2, mark(X3)) → if(X1, X2, X3)
if(active(X1), X2, X3) → if(X1, X2, X3)
if(X1, active(X2), X3) → if(X1, X2, X3)
if(X1, X2, active(X3)) → if(X1, X2, X3)
filter(mark(X1), X2) → filter(X1, X2)
filter(X1, mark(X2)) → filter(X1, X2)
filter(active(X1), X2) → filter(X1, X2)
filter(X1, active(X2)) → filter(X1, X2)
divides(mark(X1), X2) → divides(X1, X2)
divides(X1, mark(X2)) → divides(X1, X2)
divides(active(X1), X2) → divides(X1, X2)
divides(X1, active(X2)) → divides(X1, X2)

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
By narrowing [15] the rule MARK(if(X1, X2, X3)) → ACTIVE(if(mark(X1), X2, X3)) at position [0] we obtained the following new rules:

MARK(if(sieve(x0), y1, y2)) → ACTIVE(if(active(sieve(mark(x0))), y1, y2))
MARK(if(divides(x0, x1), y1, y2)) → ACTIVE(if(active(divides(mark(x0), mark(x1))), y1, y2))
MARK(if(0, y1, y2)) → ACTIVE(if(active(0), y1, y2))
MARK(if(s(x0), y1, y2)) → ACTIVE(if(active(s(mark(x0))), y1, y2))
MARK(if(cons(x0, x1), y1, y2)) → ACTIVE(if(active(cons(mark(x0), x1)), y1, y2))
MARK(if(y0, active(x1), x2)) → ACTIVE(if(mark(y0), x1, x2))
MARK(if(true, y1, y2)) → ACTIVE(if(active(true), y1, y2))
MARK(if(primes, y1, y2)) → ACTIVE(if(active(primes), y1, y2))
MARK(if(x0, x1, x2)) → ACTIVE(if(x0, x1, x2))
MARK(if(tail(x0), y1, y2)) → ACTIVE(if(active(tail(mark(x0))), y1, y2))
MARK(if(false, y1, y2)) → ACTIVE(if(active(false), y1, y2))
MARK(if(y0, x1, mark(x2))) → ACTIVE(if(mark(y0), x1, x2))
MARK(if(from(x0), y1, y2)) → ACTIVE(if(active(from(mark(x0))), y1, y2))
MARK(if(filter(x0, x1), y1, y2)) → ACTIVE(if(active(filter(mark(x0), mark(x1))), y1, y2))
MARK(if(head(x0), y1, y2)) → ACTIVE(if(active(head(mark(x0))), y1, y2))
MARK(if(y0, mark(x1), x2)) → ACTIVE(if(mark(y0), x1, x2))
MARK(if(if(x0, x1, x2), y1, y2)) → ACTIVE(if(active(if(mark(x0), x1, x2)), y1, y2))
MARK(if(y0, x1, active(x2))) → ACTIVE(if(mark(y0), x1, x2))



↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
            ↳ QDPOrderProof
              ↳ QDP
                ↳ Narrowing
                  ↳ QDP
                    ↳ Narrowing
QDP
                        ↳ Narrowing

Q DP problem:
The TRS P consists of the following rules:

MARK(sieve(sieve(x0))) → ACTIVE(sieve(active(sieve(mark(x0)))))
MARK(if(0, y1, y2)) → ACTIVE(if(active(0), y1, y2))
MARK(head(X)) → MARK(X)
MARK(tail(X)) → MARK(X)
MARK(cons(X1, X2)) → MARK(X1)
MARK(if(y0, active(x1), x2)) → ACTIVE(if(mark(y0), x1, x2))
MARK(if(y0, x1, mark(x2))) → ACTIVE(if(mark(y0), x1, x2))
ACTIVE(filter(s(s(X)), cons(Y, Z))) → MARK(if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y)))))
MARK(sieve(filter(x0, x1))) → ACTIVE(sieve(active(filter(mark(x0), mark(x1)))))
MARK(sieve(if(x0, x1, x2))) → ACTIVE(sieve(active(if(mark(x0), x1, x2))))
MARK(if(X1, X2, X3)) → MARK(X1)
MARK(sieve(x0)) → ACTIVE(sieve(x0))
ACTIVE(from(X)) → MARK(cons(X, from(s(X))))
MARK(sieve(s(x0))) → ACTIVE(sieve(active(s(mark(x0)))))
MARK(sieve(primes)) → ACTIVE(sieve(active(primes)))
MARK(sieve(0)) → ACTIVE(sieve(active(0)))
MARK(tail(X)) → ACTIVE(tail(mark(X)))
MARK(sieve(divides(x0, x1))) → ACTIVE(sieve(active(divides(mark(x0), mark(x1)))))
MARK(if(x0, x1, x2)) → ACTIVE(if(x0, x1, x2))
MARK(if(head(x0), y1, y2)) → ACTIVE(if(active(head(mark(x0))), y1, y2))
MARK(if(y0, mark(x1), x2)) → ACTIVE(if(mark(y0), x1, x2))
MARK(if(if(x0, x1, x2), y1, y2)) → ACTIVE(if(active(if(mark(x0), x1, x2)), y1, y2))
MARK(if(sieve(x0), y1, y2)) → ACTIVE(if(active(sieve(mark(x0))), y1, y2))
MARK(primes) → ACTIVE(primes)
MARK(filter(X1, X2)) → MARK(X2)
MARK(s(X)) → MARK(X)
ACTIVE(if(false, X, Y)) → MARK(Y)
ACTIVE(sieve(cons(X, Y))) → MARK(cons(X, filter(X, sieve(Y))))
MARK(sieve(cons(x0, x1))) → ACTIVE(sieve(active(cons(mark(x0), x1))))
MARK(if(true, y1, y2)) → ACTIVE(if(active(true), y1, y2))
MARK(if(primes, y1, y2)) → ACTIVE(if(active(primes), y1, y2))
MARK(sieve(tail(x0))) → ACTIVE(sieve(active(tail(mark(x0)))))
MARK(if(tail(x0), y1, y2)) → ACTIVE(if(active(tail(mark(x0))), y1, y2))
MARK(sieve(from(x0))) → ACTIVE(sieve(active(from(mark(x0)))))
MARK(if(filter(x0, x1), y1, y2)) → ACTIVE(if(active(filter(mark(x0), mark(x1))), y1, y2))
MARK(from(X)) → MARK(X)
MARK(sieve(true)) → ACTIVE(sieve(active(true)))
MARK(if(divides(x0, x1), y1, y2)) → ACTIVE(if(active(divides(mark(x0), mark(x1))), y1, y2))
MARK(if(s(x0), y1, y2)) → ACTIVE(if(active(s(mark(x0))), y1, y2))
MARK(divides(X1, X2)) → MARK(X2)
MARK(sieve(false)) → ACTIVE(sieve(active(false)))
MARK(filter(X1, X2)) → ACTIVE(filter(mark(X1), mark(X2)))
MARK(if(cons(x0, x1), y1, y2)) → ACTIVE(if(active(cons(mark(x0), x1)), y1, y2))
MARK(head(X)) → ACTIVE(head(mark(X)))
ACTIVE(primes) → MARK(sieve(from(s(s(0)))))
MARK(filter(X1, X2)) → MARK(X1)
MARK(if(false, y1, y2)) → ACTIVE(if(active(false), y1, y2))
MARK(from(X)) → ACTIVE(from(mark(X)))
MARK(sieve(head(x0))) → ACTIVE(sieve(active(head(mark(x0)))))
ACTIVE(head(cons(X, Y))) → MARK(X)
MARK(divides(X1, X2)) → MARK(X1)
MARK(if(from(x0), y1, y2)) → ACTIVE(if(active(from(mark(x0))), y1, y2))
MARK(sieve(X)) → MARK(X)
ACTIVE(if(true, X, Y)) → MARK(X)
MARK(if(y0, x1, active(x2))) → ACTIVE(if(mark(y0), x1, x2))
ACTIVE(tail(cons(X, Y))) → MARK(Y)

The TRS R consists of the following rules:

active(primes) → mark(sieve(from(s(s(0)))))
active(from(X)) → mark(cons(X, from(s(X))))
active(head(cons(X, Y))) → mark(X)
active(tail(cons(X, Y))) → mark(Y)
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(filter(s(s(X)), cons(Y, Z))) → mark(if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y)))))
active(sieve(cons(X, Y))) → mark(cons(X, filter(X, sieve(Y))))
mark(primes) → active(primes)
mark(sieve(X)) → active(sieve(mark(X)))
mark(from(X)) → active(from(mark(X)))
mark(s(X)) → active(s(mark(X)))
mark(0) → active(0)
mark(cons(X1, X2)) → active(cons(mark(X1), X2))
mark(head(X)) → active(head(mark(X)))
mark(tail(X)) → active(tail(mark(X)))
mark(if(X1, X2, X3)) → active(if(mark(X1), X2, X3))
mark(true) → active(true)
mark(false) → active(false)
mark(filter(X1, X2)) → active(filter(mark(X1), mark(X2)))
mark(divides(X1, X2)) → active(divides(mark(X1), mark(X2)))
sieve(mark(X)) → sieve(X)
sieve(active(X)) → sieve(X)
from(mark(X)) → from(X)
from(active(X)) → from(X)
s(mark(X)) → s(X)
s(active(X)) → s(X)
cons(mark(X1), X2) → cons(X1, X2)
cons(X1, mark(X2)) → cons(X1, X2)
cons(active(X1), X2) → cons(X1, X2)
cons(X1, active(X2)) → cons(X1, X2)
head(mark(X)) → head(X)
head(active(X)) → head(X)
tail(mark(X)) → tail(X)
tail(active(X)) → tail(X)
if(mark(X1), X2, X3) → if(X1, X2, X3)
if(X1, mark(X2), X3) → if(X1, X2, X3)
if(X1, X2, mark(X3)) → if(X1, X2, X3)
if(active(X1), X2, X3) → if(X1, X2, X3)
if(X1, active(X2), X3) → if(X1, X2, X3)
if(X1, X2, active(X3)) → if(X1, X2, X3)
filter(mark(X1), X2) → filter(X1, X2)
filter(X1, mark(X2)) → filter(X1, X2)
filter(active(X1), X2) → filter(X1, X2)
filter(X1, active(X2)) → filter(X1, X2)
divides(mark(X1), X2) → divides(X1, X2)
divides(X1, mark(X2)) → divides(X1, X2)
divides(active(X1), X2) → divides(X1, X2)
divides(X1, active(X2)) → divides(X1, X2)

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
By narrowing [15] the rule MARK(filter(X1, X2)) → ACTIVE(filter(mark(X1), mark(X2))) at position [0] we obtained the following new rules:

MARK(filter(y0, x1)) → ACTIVE(filter(mark(y0), x1))
MARK(filter(y0, from(x0))) → ACTIVE(filter(mark(y0), active(from(mark(x0)))))
MARK(filter(s(x0), y1)) → ACTIVE(filter(active(s(mark(x0))), mark(y1)))
MARK(filter(from(x0), y1)) → ACTIVE(filter(active(from(mark(x0))), mark(y1)))
MARK(filter(filter(x0, x1), y1)) → ACTIVE(filter(active(filter(mark(x0), mark(x1))), mark(y1)))
MARK(filter(tail(x0), y1)) → ACTIVE(filter(active(tail(mark(x0))), mark(y1)))
MARK(filter(0, y1)) → ACTIVE(filter(active(0), mark(y1)))
MARK(filter(y0, 0)) → ACTIVE(filter(mark(y0), active(0)))
MARK(filter(head(x0), y1)) → ACTIVE(filter(active(head(mark(x0))), mark(y1)))
MARK(filter(y0, tail(x0))) → ACTIVE(filter(mark(y0), active(tail(mark(x0)))))
MARK(filter(divides(x0, x1), y1)) → ACTIVE(filter(active(divides(mark(x0), mark(x1))), mark(y1)))
MARK(filter(y0, cons(x0, x1))) → ACTIVE(filter(mark(y0), active(cons(mark(x0), x1))))
MARK(filter(y0, if(x0, x1, x2))) → ACTIVE(filter(mark(y0), active(if(mark(x0), x1, x2))))
MARK(filter(true, y1)) → ACTIVE(filter(active(true), mark(y1)))
MARK(filter(y0, true)) → ACTIVE(filter(mark(y0), active(true)))
MARK(filter(sieve(x0), y1)) → ACTIVE(filter(active(sieve(mark(x0))), mark(y1)))
MARK(filter(y0, s(x0))) → ACTIVE(filter(mark(y0), active(s(mark(x0)))))
MARK(filter(y0, head(x0))) → ACTIVE(filter(mark(y0), active(head(mark(x0)))))
MARK(filter(y0, sieve(x0))) → ACTIVE(filter(mark(y0), active(sieve(mark(x0)))))
MARK(filter(if(x0, x1, x2), y1)) → ACTIVE(filter(active(if(mark(x0), x1, x2)), mark(y1)))
MARK(filter(y0, false)) → ACTIVE(filter(mark(y0), active(false)))
MARK(filter(false, y1)) → ACTIVE(filter(active(false), mark(y1)))
MARK(filter(primes, y1)) → ACTIVE(filter(active(primes), mark(y1)))
MARK(filter(y0, primes)) → ACTIVE(filter(mark(y0), active(primes)))
MARK(filter(y0, divides(x0, x1))) → ACTIVE(filter(mark(y0), active(divides(mark(x0), mark(x1)))))
MARK(filter(y0, filter(x0, x1))) → ACTIVE(filter(mark(y0), active(filter(mark(x0), mark(x1)))))
MARK(filter(x0, y1)) → ACTIVE(filter(x0, mark(y1)))
MARK(filter(cons(x0, x1), y1)) → ACTIVE(filter(active(cons(mark(x0), x1)), mark(y1)))



↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
            ↳ QDPOrderProof
              ↳ QDP
                ↳ Narrowing
                  ↳ QDP
                    ↳ Narrowing
                      ↳ QDP
                        ↳ Narrowing
QDP
                            ↳ Narrowing

Q DP problem:
The TRS P consists of the following rules:

MARK(filter(y0, x1)) → ACTIVE(filter(mark(y0), x1))
MARK(sieve(sieve(x0))) → ACTIVE(sieve(active(sieve(mark(x0)))))
MARK(if(0, y1, y2)) → ACTIVE(if(active(0), y1, y2))
MARK(filter(y0, from(x0))) → ACTIVE(filter(mark(y0), active(from(mark(x0)))))
MARK(tail(X)) → MARK(X)
MARK(head(X)) → MARK(X)
MARK(cons(X1, X2)) → MARK(X1)
MARK(if(y0, active(x1), x2)) → ACTIVE(if(mark(y0), x1, x2))
ACTIVE(filter(s(s(X)), cons(Y, Z))) → MARK(if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y)))))
MARK(if(y0, x1, mark(x2))) → ACTIVE(if(mark(y0), x1, x2))
MARK(sieve(filter(x0, x1))) → ACTIVE(sieve(active(filter(mark(x0), mark(x1)))))
MARK(if(X1, X2, X3)) → MARK(X1)
MARK(sieve(if(x0, x1, x2))) → ACTIVE(sieve(active(if(mark(x0), x1, x2))))
MARK(filter(y0, tail(x0))) → ACTIVE(filter(mark(y0), active(tail(mark(x0)))))
MARK(sieve(x0)) → ACTIVE(sieve(x0))
ACTIVE(from(X)) → MARK(cons(X, from(s(X))))
MARK(sieve(s(x0))) → ACTIVE(sieve(active(s(mark(x0)))))
MARK(sieve(primes)) → ACTIVE(sieve(active(primes)))
MARK(sieve(0)) → ACTIVE(sieve(active(0)))
MARK(filter(y0, if(x0, x1, x2))) → ACTIVE(filter(mark(y0), active(if(mark(x0), x1, x2))))
MARK(tail(X)) → ACTIVE(tail(mark(X)))
MARK(filter(y0, true)) → ACTIVE(filter(mark(y0), active(true)))
MARK(filter(true, y1)) → ACTIVE(filter(active(true), mark(y1)))
MARK(sieve(divides(x0, x1))) → ACTIVE(sieve(active(divides(mark(x0), mark(x1)))))
MARK(if(x0, x1, x2)) → ACTIVE(if(x0, x1, x2))
MARK(filter(sieve(x0), y1)) → ACTIVE(filter(active(sieve(mark(x0))), mark(y1)))
MARK(filter(y0, s(x0))) → ACTIVE(filter(mark(y0), active(s(mark(x0)))))
MARK(if(head(x0), y1, y2)) → ACTIVE(if(active(head(mark(x0))), y1, y2))
MARK(if(y0, mark(x1), x2)) → ACTIVE(if(mark(y0), x1, x2))
MARK(if(if(x0, x1, x2), y1, y2)) → ACTIVE(if(active(if(mark(x0), x1, x2)), y1, y2))
MARK(if(sieve(x0), y1, y2)) → ACTIVE(if(active(sieve(mark(x0))), y1, y2))
MARK(primes) → ACTIVE(primes)
MARK(s(X)) → MARK(X)
MARK(filter(X1, X2)) → MARK(X2)
ACTIVE(sieve(cons(X, Y))) → MARK(cons(X, filter(X, sieve(Y))))
ACTIVE(if(false, X, Y)) → MARK(Y)
MARK(sieve(cons(x0, x1))) → ACTIVE(sieve(active(cons(mark(x0), x1))))
MARK(filter(s(x0), y1)) → ACTIVE(filter(active(s(mark(x0))), mark(y1)))
MARK(if(primes, y1, y2)) → ACTIVE(if(active(primes), y1, y2))
MARK(if(true, y1, y2)) → ACTIVE(if(active(true), y1, y2))
MARK(if(tail(x0), y1, y2)) → ACTIVE(if(active(tail(mark(x0))), y1, y2))
MARK(sieve(tail(x0))) → ACTIVE(sieve(active(tail(mark(x0)))))
MARK(sieve(from(x0))) → ACTIVE(sieve(active(from(mark(x0)))))
MARK(filter(from(x0), y1)) → ACTIVE(filter(active(from(mark(x0))), mark(y1)))
MARK(filter(filter(x0, x1), y1)) → ACTIVE(filter(active(filter(mark(x0), mark(x1))), mark(y1)))
MARK(filter(y0, 0)) → ACTIVE(filter(mark(y0), active(0)))
MARK(filter(0, y1)) → ACTIVE(filter(active(0), mark(y1)))
MARK(filter(tail(x0), y1)) → ACTIVE(filter(active(tail(mark(x0))), mark(y1)))
MARK(if(filter(x0, x1), y1, y2)) → ACTIVE(if(active(filter(mark(x0), mark(x1))), y1, y2))
MARK(filter(head(x0), y1)) → ACTIVE(filter(active(head(mark(x0))), mark(y1)))
MARK(filter(divides(x0, x1), y1)) → ACTIVE(filter(active(divides(mark(x0), mark(x1))), mark(y1)))
MARK(from(X)) → MARK(X)
MARK(filter(y0, cons(x0, x1))) → ACTIVE(filter(mark(y0), active(cons(mark(x0), x1))))
MARK(if(divides(x0, x1), y1, y2)) → ACTIVE(if(active(divides(mark(x0), mark(x1))), y1, y2))
MARK(sieve(true)) → ACTIVE(sieve(active(true)))
MARK(if(s(x0), y1, y2)) → ACTIVE(if(active(s(mark(x0))), y1, y2))
MARK(divides(X1, X2)) → MARK(X2)
MARK(if(cons(x0, x1), y1, y2)) → ACTIVE(if(active(cons(mark(x0), x1)), y1, y2))
MARK(sieve(false)) → ACTIVE(sieve(active(false)))
MARK(head(X)) → ACTIVE(head(mark(X)))
ACTIVE(primes) → MARK(sieve(from(s(s(0)))))
MARK(filter(X1, X2)) → MARK(X1)
MARK(if(false, y1, y2)) → ACTIVE(if(active(false), y1, y2))
MARK(filter(y0, head(x0))) → ACTIVE(filter(mark(y0), active(head(mark(x0)))))
MARK(filter(y0, sieve(x0))) → ACTIVE(filter(mark(y0), active(sieve(mark(x0)))))
MARK(filter(if(x0, x1, x2), y1)) → ACTIVE(filter(active(if(mark(x0), x1, x2)), mark(y1)))
MARK(from(X)) → ACTIVE(from(mark(X)))
MARK(divides(X1, X2)) → MARK(X1)
ACTIVE(head(cons(X, Y))) → MARK(X)
MARK(sieve(head(x0))) → ACTIVE(sieve(active(head(mark(x0)))))
MARK(filter(false, y1)) → ACTIVE(filter(active(false), mark(y1)))
MARK(filter(y0, false)) → ACTIVE(filter(mark(y0), active(false)))
MARK(filter(y0, primes)) → ACTIVE(filter(mark(y0), active(primes)))
MARK(filter(primes, y1)) → ACTIVE(filter(active(primes), mark(y1)))
MARK(if(from(x0), y1, y2)) → ACTIVE(if(active(from(mark(x0))), y1, y2))
MARK(sieve(X)) → MARK(X)
MARK(filter(y0, filter(x0, x1))) → ACTIVE(filter(mark(y0), active(filter(mark(x0), mark(x1)))))
MARK(filter(y0, divides(x0, x1))) → ACTIVE(filter(mark(y0), active(divides(mark(x0), mark(x1)))))
MARK(filter(x0, y1)) → ACTIVE(filter(x0, mark(y1)))
ACTIVE(if(true, X, Y)) → MARK(X)
MARK(filter(cons(x0, x1), y1)) → ACTIVE(filter(active(cons(mark(x0), x1)), mark(y1)))
ACTIVE(tail(cons(X, Y))) → MARK(Y)
MARK(if(y0, x1, active(x2))) → ACTIVE(if(mark(y0), x1, x2))

The TRS R consists of the following rules:

active(primes) → mark(sieve(from(s(s(0)))))
active(from(X)) → mark(cons(X, from(s(X))))
active(head(cons(X, Y))) → mark(X)
active(tail(cons(X, Y))) → mark(Y)
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(filter(s(s(X)), cons(Y, Z))) → mark(if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y)))))
active(sieve(cons(X, Y))) → mark(cons(X, filter(X, sieve(Y))))
mark(primes) → active(primes)
mark(sieve(X)) → active(sieve(mark(X)))
mark(from(X)) → active(from(mark(X)))
mark(s(X)) → active(s(mark(X)))
mark(0) → active(0)
mark(cons(X1, X2)) → active(cons(mark(X1), X2))
mark(head(X)) → active(head(mark(X)))
mark(tail(X)) → active(tail(mark(X)))
mark(if(X1, X2, X3)) → active(if(mark(X1), X2, X3))
mark(true) → active(true)
mark(false) → active(false)
mark(filter(X1, X2)) → active(filter(mark(X1), mark(X2)))
mark(divides(X1, X2)) → active(divides(mark(X1), mark(X2)))
sieve(mark(X)) → sieve(X)
sieve(active(X)) → sieve(X)
from(mark(X)) → from(X)
from(active(X)) → from(X)
s(mark(X)) → s(X)
s(active(X)) → s(X)
cons(mark(X1), X2) → cons(X1, X2)
cons(X1, mark(X2)) → cons(X1, X2)
cons(active(X1), X2) → cons(X1, X2)
cons(X1, active(X2)) → cons(X1, X2)
head(mark(X)) → head(X)
head(active(X)) → head(X)
tail(mark(X)) → tail(X)
tail(active(X)) → tail(X)
if(mark(X1), X2, X3) → if(X1, X2, X3)
if(X1, mark(X2), X3) → if(X1, X2, X3)
if(X1, X2, mark(X3)) → if(X1, X2, X3)
if(active(X1), X2, X3) → if(X1, X2, X3)
if(X1, active(X2), X3) → if(X1, X2, X3)
if(X1, X2, active(X3)) → if(X1, X2, X3)
filter(mark(X1), X2) → filter(X1, X2)
filter(X1, mark(X2)) → filter(X1, X2)
filter(active(X1), X2) → filter(X1, X2)
filter(X1, active(X2)) → filter(X1, X2)
divides(mark(X1), X2) → divides(X1, X2)
divides(X1, mark(X2)) → divides(X1, X2)
divides(active(X1), X2) → divides(X1, X2)
divides(X1, active(X2)) → divides(X1, X2)

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
By narrowing [15] the rule MARK(head(X)) → ACTIVE(head(mark(X))) at position [0] we obtained the following new rules:

MARK(head(if(x0, x1, x2))) → ACTIVE(head(active(if(mark(x0), x1, x2))))
MARK(head(from(x0))) → ACTIVE(head(active(from(mark(x0)))))
MARK(head(true)) → ACTIVE(head(active(true)))
MARK(head(filter(x0, x1))) → ACTIVE(head(active(filter(mark(x0), mark(x1)))))
MARK(head(primes)) → ACTIVE(head(active(primes)))
MARK(head(x0)) → ACTIVE(head(x0))
MARK(head(s(x0))) → ACTIVE(head(active(s(mark(x0)))))
MARK(head(divides(x0, x1))) → ACTIVE(head(active(divides(mark(x0), mark(x1)))))
MARK(head(0)) → ACTIVE(head(active(0)))
MARK(head(tail(x0))) → ACTIVE(head(active(tail(mark(x0)))))
MARK(head(head(x0))) → ACTIVE(head(active(head(mark(x0)))))
MARK(head(cons(x0, x1))) → ACTIVE(head(active(cons(mark(x0), x1))))
MARK(head(sieve(x0))) → ACTIVE(head(active(sieve(mark(x0)))))
MARK(head(false)) → ACTIVE(head(active(false)))



↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
            ↳ QDPOrderProof
              ↳ QDP
                ↳ Narrowing
                  ↳ QDP
                    ↳ Narrowing
                      ↳ QDP
                        ↳ Narrowing
                          ↳ QDP
                            ↳ Narrowing
QDP
                                ↳ Narrowing

Q DP problem:
The TRS P consists of the following rules:

MARK(filter(y0, x1)) → ACTIVE(filter(mark(y0), x1))
MARK(sieve(sieve(x0))) → ACTIVE(sieve(active(sieve(mark(x0)))))
MARK(if(0, y1, y2)) → ACTIVE(if(active(0), y1, y2))
MARK(head(if(x0, x1, x2))) → ACTIVE(head(active(if(mark(x0), x1, x2))))
MARK(if(y0, active(x1), x2)) → ACTIVE(if(mark(y0), x1, x2))
MARK(head(primes)) → ACTIVE(head(active(primes)))
MARK(sieve(filter(x0, x1))) → ACTIVE(sieve(active(filter(mark(x0), mark(x1)))))
MARK(head(0)) → ACTIVE(head(active(0)))
MARK(head(tail(x0))) → ACTIVE(head(active(tail(mark(x0)))))
MARK(if(X1, X2, X3)) → MARK(X1)
MARK(head(cons(x0, x1))) → ACTIVE(head(active(cons(mark(x0), x1))))
MARK(sieve(x0)) → ACTIVE(sieve(x0))
ACTIVE(from(X)) → MARK(cons(X, from(s(X))))
MARK(filter(y0, true)) → ACTIVE(filter(mark(y0), active(true)))
MARK(filter(true, y1)) → ACTIVE(filter(active(true), mark(y1)))
MARK(head(x0)) → ACTIVE(head(x0))
MARK(head(head(x0))) → ACTIVE(head(active(head(mark(x0)))))
MARK(head(false)) → ACTIVE(head(active(false)))
MARK(if(sieve(x0), y1, y2)) → ACTIVE(if(active(sieve(mark(x0))), y1, y2))
MARK(s(X)) → MARK(X)
MARK(filter(X1, X2)) → MARK(X2)
ACTIVE(sieve(cons(X, Y))) → MARK(cons(X, filter(X, sieve(Y))))
MARK(sieve(cons(x0, x1))) → ACTIVE(sieve(active(cons(mark(x0), x1))))
MARK(filter(from(x0), y1)) → ACTIVE(filter(active(from(mark(x0))), mark(y1)))
MARK(filter(tail(x0), y1)) → ACTIVE(filter(active(tail(mark(x0))), mark(y1)))
MARK(filter(y0, cons(x0, x1))) → ACTIVE(filter(mark(y0), active(cons(mark(x0), x1))))
MARK(if(s(x0), y1, y2)) → ACTIVE(if(active(s(mark(x0))), y1, y2))
MARK(divides(X1, X2)) → MARK(X2)
MARK(filter(y0, sieve(x0))) → ACTIVE(filter(mark(y0), active(sieve(mark(x0)))))
MARK(divides(X1, X2)) → MARK(X1)
MARK(sieve(X)) → MARK(X)
MARK(head(sieve(x0))) → ACTIVE(head(active(sieve(mark(x0)))))
MARK(filter(y0, filter(x0, x1))) → ACTIVE(filter(mark(y0), active(filter(mark(x0), mark(x1)))))
MARK(filter(x0, y1)) → ACTIVE(filter(x0, mark(y1)))
ACTIVE(if(true, X, Y)) → MARK(X)
ACTIVE(tail(cons(X, Y))) → MARK(Y)
MARK(if(y0, x1, active(x2))) → ACTIVE(if(mark(y0), x1, x2))
MARK(filter(y0, from(x0))) → ACTIVE(filter(mark(y0), active(from(mark(x0)))))
MARK(tail(X)) → MARK(X)
MARK(head(X)) → MARK(X)
MARK(cons(X1, X2)) → MARK(X1)
ACTIVE(filter(s(s(X)), cons(Y, Z))) → MARK(if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y)))))
MARK(if(y0, x1, mark(x2))) → ACTIVE(if(mark(y0), x1, x2))
MARK(head(divides(x0, x1))) → ACTIVE(head(active(divides(mark(x0), mark(x1)))))
MARK(sieve(if(x0, x1, x2))) → ACTIVE(sieve(active(if(mark(x0), x1, x2))))
MARK(filter(y0, tail(x0))) → ACTIVE(filter(mark(y0), active(tail(mark(x0)))))
MARK(sieve(s(x0))) → ACTIVE(sieve(active(s(mark(x0)))))
MARK(sieve(primes)) → ACTIVE(sieve(active(primes)))
MARK(sieve(0)) → ACTIVE(sieve(active(0)))
MARK(filter(y0, if(x0, x1, x2))) → ACTIVE(filter(mark(y0), active(if(mark(x0), x1, x2))))
MARK(tail(X)) → ACTIVE(tail(mark(X)))
MARK(head(filter(x0, x1))) → ACTIVE(head(active(filter(mark(x0), mark(x1)))))
MARK(sieve(divides(x0, x1))) → ACTIVE(sieve(active(divides(mark(x0), mark(x1)))))
MARK(if(x0, x1, x2)) → ACTIVE(if(x0, x1, x2))
MARK(filter(sieve(x0), y1)) → ACTIVE(filter(active(sieve(mark(x0))), mark(y1)))
MARK(filter(y0, s(x0))) → ACTIVE(filter(mark(y0), active(s(mark(x0)))))
MARK(if(head(x0), y1, y2)) → ACTIVE(if(active(head(mark(x0))), y1, y2))
MARK(if(y0, mark(x1), x2)) → ACTIVE(if(mark(y0), x1, x2))
MARK(if(if(x0, x1, x2), y1, y2)) → ACTIVE(if(active(if(mark(x0), x1, x2)), y1, y2))
MARK(primes) → ACTIVE(primes)
ACTIVE(if(false, X, Y)) → MARK(Y)
MARK(filter(s(x0), y1)) → ACTIVE(filter(active(s(mark(x0))), mark(y1)))
MARK(if(primes, y1, y2)) → ACTIVE(if(active(primes), y1, y2))
MARK(if(true, y1, y2)) → ACTIVE(if(active(true), y1, y2))
MARK(if(tail(x0), y1, y2)) → ACTIVE(if(active(tail(mark(x0))), y1, y2))
MARK(sieve(tail(x0))) → ACTIVE(sieve(active(tail(mark(x0)))))
MARK(sieve(from(x0))) → ACTIVE(sieve(active(from(mark(x0)))))
MARK(filter(filter(x0, x1), y1)) → ACTIVE(filter(active(filter(mark(x0), mark(x1))), mark(y1)))
MARK(filter(y0, 0)) → ACTIVE(filter(mark(y0), active(0)))
MARK(filter(0, y1)) → ACTIVE(filter(active(0), mark(y1)))
MARK(if(filter(x0, x1), y1, y2)) → ACTIVE(if(active(filter(mark(x0), mark(x1))), y1, y2))
MARK(filter(head(x0), y1)) → ACTIVE(filter(active(head(mark(x0))), mark(y1)))
MARK(filter(divides(x0, x1), y1)) → ACTIVE(filter(active(divides(mark(x0), mark(x1))), mark(y1)))
MARK(from(X)) → MARK(X)
MARK(if(divides(x0, x1), y1, y2)) → ACTIVE(if(active(divides(mark(x0), mark(x1))), y1, y2))
MARK(sieve(true)) → ACTIVE(sieve(active(true)))
MARK(head(from(x0))) → ACTIVE(head(active(from(mark(x0)))))
MARK(if(cons(x0, x1), y1, y2)) → ACTIVE(if(active(cons(mark(x0), x1)), y1, y2))
MARK(sieve(false)) → ACTIVE(sieve(active(false)))
MARK(head(true)) → ACTIVE(head(active(true)))
ACTIVE(primes) → MARK(sieve(from(s(s(0)))))
MARK(filter(X1, X2)) → MARK(X1)
MARK(head(s(x0))) → ACTIVE(head(active(s(mark(x0)))))
MARK(if(false, y1, y2)) → ACTIVE(if(active(false), y1, y2))
MARK(filter(y0, head(x0))) → ACTIVE(filter(mark(y0), active(head(mark(x0)))))
MARK(filter(if(x0, x1, x2), y1)) → ACTIVE(filter(active(if(mark(x0), x1, x2)), mark(y1)))
MARK(from(X)) → ACTIVE(from(mark(X)))
ACTIVE(head(cons(X, Y))) → MARK(X)
MARK(sieve(head(x0))) → ACTIVE(sieve(active(head(mark(x0)))))
MARK(filter(false, y1)) → ACTIVE(filter(active(false), mark(y1)))
MARK(filter(y0, false)) → ACTIVE(filter(mark(y0), active(false)))
MARK(filter(y0, primes)) → ACTIVE(filter(mark(y0), active(primes)))
MARK(filter(primes, y1)) → ACTIVE(filter(active(primes), mark(y1)))
MARK(if(from(x0), y1, y2)) → ACTIVE(if(active(from(mark(x0))), y1, y2))
MARK(filter(y0, divides(x0, x1))) → ACTIVE(filter(mark(y0), active(divides(mark(x0), mark(x1)))))
MARK(filter(cons(x0, x1), y1)) → ACTIVE(filter(active(cons(mark(x0), x1)), mark(y1)))

The TRS R consists of the following rules:

active(primes) → mark(sieve(from(s(s(0)))))
active(from(X)) → mark(cons(X, from(s(X))))
active(head(cons(X, Y))) → mark(X)
active(tail(cons(X, Y))) → mark(Y)
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(filter(s(s(X)), cons(Y, Z))) → mark(if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y)))))
active(sieve(cons(X, Y))) → mark(cons(X, filter(X, sieve(Y))))
mark(primes) → active(primes)
mark(sieve(X)) → active(sieve(mark(X)))
mark(from(X)) → active(from(mark(X)))
mark(s(X)) → active(s(mark(X)))
mark(0) → active(0)
mark(cons(X1, X2)) → active(cons(mark(X1), X2))
mark(head(X)) → active(head(mark(X)))
mark(tail(X)) → active(tail(mark(X)))
mark(if(X1, X2, X3)) → active(if(mark(X1), X2, X3))
mark(true) → active(true)
mark(false) → active(false)
mark(filter(X1, X2)) → active(filter(mark(X1), mark(X2)))
mark(divides(X1, X2)) → active(divides(mark(X1), mark(X2)))
sieve(mark(X)) → sieve(X)
sieve(active(X)) → sieve(X)
from(mark(X)) → from(X)
from(active(X)) → from(X)
s(mark(X)) → s(X)
s(active(X)) → s(X)
cons(mark(X1), X2) → cons(X1, X2)
cons(X1, mark(X2)) → cons(X1, X2)
cons(active(X1), X2) → cons(X1, X2)
cons(X1, active(X2)) → cons(X1, X2)
head(mark(X)) → head(X)
head(active(X)) → head(X)
tail(mark(X)) → tail(X)
tail(active(X)) → tail(X)
if(mark(X1), X2, X3) → if(X1, X2, X3)
if(X1, mark(X2), X3) → if(X1, X2, X3)
if(X1, X2, mark(X3)) → if(X1, X2, X3)
if(active(X1), X2, X3) → if(X1, X2, X3)
if(X1, active(X2), X3) → if(X1, X2, X3)
if(X1, X2, active(X3)) → if(X1, X2, X3)
filter(mark(X1), X2) → filter(X1, X2)
filter(X1, mark(X2)) → filter(X1, X2)
filter(active(X1), X2) → filter(X1, X2)
filter(X1, active(X2)) → filter(X1, X2)
divides(mark(X1), X2) → divides(X1, X2)
divides(X1, mark(X2)) → divides(X1, X2)
divides(active(X1), X2) → divides(X1, X2)
divides(X1, active(X2)) → divides(X1, X2)

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
By narrowing [15] the rule MARK(tail(X)) → ACTIVE(tail(mark(X))) at position [0] we obtained the following new rules:

MARK(tail(divides(x0, x1))) → ACTIVE(tail(active(divides(mark(x0), mark(x1)))))
MARK(tail(true)) → ACTIVE(tail(active(true)))
MARK(tail(tail(x0))) → ACTIVE(tail(active(tail(mark(x0)))))
MARK(tail(primes)) → ACTIVE(tail(active(primes)))
MARK(tail(sieve(x0))) → ACTIVE(tail(active(sieve(mark(x0)))))
MARK(tail(false)) → ACTIVE(tail(active(false)))
MARK(tail(if(x0, x1, x2))) → ACTIVE(tail(active(if(mark(x0), x1, x2))))
MARK(tail(filter(x0, x1))) → ACTIVE(tail(active(filter(mark(x0), mark(x1)))))
MARK(tail(from(x0))) → ACTIVE(tail(active(from(mark(x0)))))
MARK(tail(cons(x0, x1))) → ACTIVE(tail(active(cons(mark(x0), x1))))
MARK(tail(x0)) → ACTIVE(tail(x0))
MARK(tail(s(x0))) → ACTIVE(tail(active(s(mark(x0)))))
MARK(tail(0)) → ACTIVE(tail(active(0)))
MARK(tail(head(x0))) → ACTIVE(tail(active(head(mark(x0)))))



↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
            ↳ QDPOrderProof
              ↳ QDP
                ↳ Narrowing
                  ↳ QDP
                    ↳ Narrowing
                      ↳ QDP
                        ↳ Narrowing
                          ↳ QDP
                            ↳ Narrowing
                              ↳ QDP
                                ↳ Narrowing
QDP
                                    ↳ Narrowing

Q DP problem:
The TRS P consists of the following rules:

MARK(filter(y0, x1)) → ACTIVE(filter(mark(y0), x1))
MARK(sieve(sieve(x0))) → ACTIVE(sieve(active(sieve(mark(x0)))))
MARK(head(if(x0, x1, x2))) → ACTIVE(head(active(if(mark(x0), x1, x2))))
MARK(if(0, y1, y2)) → ACTIVE(if(active(0), y1, y2))
MARK(if(y0, active(x1), x2)) → ACTIVE(if(mark(y0), x1, x2))
MARK(tail(sieve(x0))) → ACTIVE(tail(active(sieve(mark(x0)))))
MARK(head(primes)) → ACTIVE(head(active(primes)))
MARK(sieve(filter(x0, x1))) → ACTIVE(sieve(active(filter(mark(x0), mark(x1)))))
MARK(head(tail(x0))) → ACTIVE(head(active(tail(mark(x0)))))
MARK(head(0)) → ACTIVE(head(active(0)))
MARK(if(X1, X2, X3)) → MARK(X1)
MARK(head(cons(x0, x1))) → ACTIVE(head(active(cons(mark(x0), x1))))
MARK(sieve(x0)) → ACTIVE(sieve(x0))
ACTIVE(from(X)) → MARK(cons(X, from(s(X))))
MARK(filter(true, y1)) → ACTIVE(filter(active(true), mark(y1)))
MARK(filter(y0, true)) → ACTIVE(filter(mark(y0), active(true)))
MARK(head(x0)) → ACTIVE(head(x0))
MARK(tail(filter(x0, x1))) → ACTIVE(tail(active(filter(mark(x0), mark(x1)))))
MARK(head(head(x0))) → ACTIVE(head(active(head(mark(x0)))))
MARK(head(false)) → ACTIVE(head(active(false)))
MARK(tail(head(x0))) → ACTIVE(tail(active(head(mark(x0)))))
MARK(if(sieve(x0), y1, y2)) → ACTIVE(if(active(sieve(mark(x0))), y1, y2))
MARK(filter(X1, X2)) → MARK(X2)
MARK(s(X)) → MARK(X)
ACTIVE(sieve(cons(X, Y))) → MARK(cons(X, filter(X, sieve(Y))))
MARK(sieve(cons(x0, x1))) → ACTIVE(sieve(active(cons(mark(x0), x1))))
MARK(tail(false)) → ACTIVE(tail(active(false)))
MARK(filter(from(x0), y1)) → ACTIVE(filter(active(from(mark(x0))), mark(y1)))
MARK(filter(tail(x0), y1)) → ACTIVE(filter(active(tail(mark(x0))), mark(y1)))
MARK(tail(cons(x0, x1))) → ACTIVE(tail(active(cons(mark(x0), x1))))
MARK(tail(x0)) → ACTIVE(tail(x0))
MARK(filter(y0, cons(x0, x1))) → ACTIVE(filter(mark(y0), active(cons(mark(x0), x1))))
MARK(if(s(x0), y1, y2)) → ACTIVE(if(active(s(mark(x0))), y1, y2))
MARK(divides(X1, X2)) → MARK(X2)
MARK(filter(y0, sieve(x0))) → ACTIVE(filter(mark(y0), active(sieve(mark(x0)))))
MARK(divides(X1, X2)) → MARK(X1)
MARK(head(sieve(x0))) → ACTIVE(head(active(sieve(mark(x0)))))
MARK(sieve(X)) → MARK(X)
MARK(filter(y0, filter(x0, x1))) → ACTIVE(filter(mark(y0), active(filter(mark(x0), mark(x1)))))
ACTIVE(if(true, X, Y)) → MARK(X)
MARK(filter(x0, y1)) → ACTIVE(filter(x0, mark(y1)))
MARK(if(y0, x1, active(x2))) → ACTIVE(if(mark(y0), x1, x2))
ACTIVE(tail(cons(X, Y))) → MARK(Y)
MARK(tail(divides(x0, x1))) → ACTIVE(tail(active(divides(mark(x0), mark(x1)))))
MARK(filter(y0, from(x0))) → ACTIVE(filter(mark(y0), active(from(mark(x0)))))
MARK(head(X)) → MARK(X)
MARK(tail(X)) → MARK(X)
MARK(cons(X1, X2)) → MARK(X1)
MARK(tail(if(x0, x1, x2))) → ACTIVE(tail(active(if(mark(x0), x1, x2))))
MARK(head(divides(x0, x1))) → ACTIVE(head(active(divides(mark(x0), mark(x1)))))
MARK(if(y0, x1, mark(x2))) → ACTIVE(if(mark(y0), x1, x2))
ACTIVE(filter(s(s(X)), cons(Y, Z))) → MARK(if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y)))))
MARK(sieve(if(x0, x1, x2))) → ACTIVE(sieve(active(if(mark(x0), x1, x2))))
MARK(filter(y0, tail(x0))) → ACTIVE(filter(mark(y0), active(tail(mark(x0)))))
MARK(sieve(s(x0))) → ACTIVE(sieve(active(s(mark(x0)))))
MARK(sieve(primes)) → ACTIVE(sieve(active(primes)))
MARK(sieve(0)) → ACTIVE(sieve(active(0)))
MARK(filter(y0, if(x0, x1, x2))) → ACTIVE(filter(mark(y0), active(if(mark(x0), x1, x2))))
MARK(head(filter(x0, x1))) → ACTIVE(head(active(filter(mark(x0), mark(x1)))))
MARK(sieve(divides(x0, x1))) → ACTIVE(sieve(active(divides(mark(x0), mark(x1)))))
MARK(if(x0, x1, x2)) → ACTIVE(if(x0, x1, x2))
MARK(filter(sieve(x0), y1)) → ACTIVE(filter(active(sieve(mark(x0))), mark(y1)))
MARK(filter(y0, s(x0))) → ACTIVE(filter(mark(y0), active(s(mark(x0)))))
MARK(if(head(x0), y1, y2)) → ACTIVE(if(active(head(mark(x0))), y1, y2))
MARK(tail(s(x0))) → ACTIVE(tail(active(s(mark(x0)))))
MARK(if(y0, mark(x1), x2)) → ACTIVE(if(mark(y0), x1, x2))
MARK(tail(0)) → ACTIVE(tail(active(0)))
MARK(if(if(x0, x1, x2), y1, y2)) → ACTIVE(if(active(if(mark(x0), x1, x2)), y1, y2))
MARK(primes) → ACTIVE(primes)
MARK(tail(true)) → ACTIVE(tail(active(true)))
ACTIVE(if(false, X, Y)) → MARK(Y)
MARK(tail(primes)) → ACTIVE(tail(active(primes)))
MARK(if(true, y1, y2)) → ACTIVE(if(active(true), y1, y2))
MARK(if(primes, y1, y2)) → ACTIVE(if(active(primes), y1, y2))
MARK(filter(s(x0), y1)) → ACTIVE(filter(active(s(mark(x0))), mark(y1)))
MARK(sieve(tail(x0))) → ACTIVE(sieve(active(tail(mark(x0)))))
MARK(if(tail(x0), y1, y2)) → ACTIVE(if(active(tail(mark(x0))), y1, y2))
MARK(sieve(from(x0))) → ACTIVE(sieve(active(from(mark(x0)))))
MARK(filter(filter(x0, x1), y1)) → ACTIVE(filter(active(filter(mark(x0), mark(x1))), mark(y1)))
MARK(filter(0, y1)) → ACTIVE(filter(active(0), mark(y1)))
MARK(filter(y0, 0)) → ACTIVE(filter(mark(y0), active(0)))
MARK(if(filter(x0, x1), y1, y2)) → ACTIVE(if(active(filter(mark(x0), mark(x1))), y1, y2))
MARK(filter(head(x0), y1)) → ACTIVE(filter(active(head(mark(x0))), mark(y1)))
MARK(filter(divides(x0, x1), y1)) → ACTIVE(filter(active(divides(mark(x0), mark(x1))), mark(y1)))
MARK(from(X)) → MARK(X)
MARK(sieve(true)) → ACTIVE(sieve(active(true)))
MARK(if(divides(x0, x1), y1, y2)) → ACTIVE(if(active(divides(mark(x0), mark(x1))), y1, y2))
MARK(tail(tail(x0))) → ACTIVE(tail(active(tail(mark(x0)))))
MARK(head(from(x0))) → ACTIVE(head(active(from(mark(x0)))))
MARK(head(true)) → ACTIVE(head(active(true)))
MARK(sieve(false)) → ACTIVE(sieve(active(false)))
MARK(if(cons(x0, x1), y1, y2)) → ACTIVE(if(active(cons(mark(x0), x1)), y1, y2))
ACTIVE(primes) → MARK(sieve(from(s(s(0)))))
MARK(filter(X1, X2)) → MARK(X1)
MARK(head(s(x0))) → ACTIVE(head(active(s(mark(x0)))))
MARK(if(false, y1, y2)) → ACTIVE(if(active(false), y1, y2))
MARK(filter(y0, head(x0))) → ACTIVE(filter(mark(y0), active(head(mark(x0)))))
MARK(filter(if(x0, x1, x2), y1)) → ACTIVE(filter(active(if(mark(x0), x1, x2)), mark(y1)))
MARK(from(X)) → ACTIVE(from(mark(X)))
MARK(sieve(head(x0))) → ACTIVE(sieve(active(head(mark(x0)))))
ACTIVE(head(cons(X, Y))) → MARK(X)
MARK(tail(from(x0))) → ACTIVE(tail(active(from(mark(x0)))))
MARK(filter(y0, false)) → ACTIVE(filter(mark(y0), active(false)))
MARK(filter(false, y1)) → ACTIVE(filter(active(false), mark(y1)))
MARK(filter(primes, y1)) → ACTIVE(filter(active(primes), mark(y1)))
MARK(filter(y0, primes)) → ACTIVE(filter(mark(y0), active(primes)))
MARK(if(from(x0), y1, y2)) → ACTIVE(if(active(from(mark(x0))), y1, y2))
MARK(filter(y0, divides(x0, x1))) → ACTIVE(filter(mark(y0), active(divides(mark(x0), mark(x1)))))
MARK(filter(cons(x0, x1), y1)) → ACTIVE(filter(active(cons(mark(x0), x1)), mark(y1)))

The TRS R consists of the following rules:

active(primes) → mark(sieve(from(s(s(0)))))
active(from(X)) → mark(cons(X, from(s(X))))
active(head(cons(X, Y))) → mark(X)
active(tail(cons(X, Y))) → mark(Y)
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(filter(s(s(X)), cons(Y, Z))) → mark(if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y)))))
active(sieve(cons(X, Y))) → mark(cons(X, filter(X, sieve(Y))))
mark(primes) → active(primes)
mark(sieve(X)) → active(sieve(mark(X)))
mark(from(X)) → active(from(mark(X)))
mark(s(X)) → active(s(mark(X)))
mark(0) → active(0)
mark(cons(X1, X2)) → active(cons(mark(X1), X2))
mark(head(X)) → active(head(mark(X)))
mark(tail(X)) → active(tail(mark(X)))
mark(if(X1, X2, X3)) → active(if(mark(X1), X2, X3))
mark(true) → active(true)
mark(false) → active(false)
mark(filter(X1, X2)) → active(filter(mark(X1), mark(X2)))
mark(divides(X1, X2)) → active(divides(mark(X1), mark(X2)))
sieve(mark(X)) → sieve(X)
sieve(active(X)) → sieve(X)
from(mark(X)) → from(X)
from(active(X)) → from(X)
s(mark(X)) → s(X)
s(active(X)) → s(X)
cons(mark(X1), X2) → cons(X1, X2)
cons(X1, mark(X2)) → cons(X1, X2)
cons(active(X1), X2) → cons(X1, X2)
cons(X1, active(X2)) → cons(X1, X2)
head(mark(X)) → head(X)
head(active(X)) → head(X)
tail(mark(X)) → tail(X)
tail(active(X)) → tail(X)
if(mark(X1), X2, X3) → if(X1, X2, X3)
if(X1, mark(X2), X3) → if(X1, X2, X3)
if(X1, X2, mark(X3)) → if(X1, X2, X3)
if(active(X1), X2, X3) → if(X1, X2, X3)
if(X1, active(X2), X3) → if(X1, X2, X3)
if(X1, X2, active(X3)) → if(X1, X2, X3)
filter(mark(X1), X2) → filter(X1, X2)
filter(X1, mark(X2)) → filter(X1, X2)
filter(active(X1), X2) → filter(X1, X2)
filter(X1, active(X2)) → filter(X1, X2)
divides(mark(X1), X2) → divides(X1, X2)
divides(X1, mark(X2)) → divides(X1, X2)
divides(active(X1), X2) → divides(X1, X2)
divides(X1, active(X2)) → divides(X1, X2)

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
By narrowing [15] the rule MARK(sieve(true)) → ACTIVE(sieve(active(true))) at position [0] we obtained the following new rules:

MARK(sieve(true)) → ACTIVE(sieve(true))



↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
            ↳ QDPOrderProof
              ↳ QDP
                ↳ Narrowing
                  ↳ QDP
                    ↳ Narrowing
                      ↳ QDP
                        ↳ Narrowing
                          ↳ QDP
                            ↳ Narrowing
                              ↳ QDP
                                ↳ Narrowing
                                  ↳ QDP
                                    ↳ Narrowing
QDP
                                        ↳ DependencyGraphProof

Q DP problem:
The TRS P consists of the following rules:

MARK(filter(y0, x1)) → ACTIVE(filter(mark(y0), x1))
MARK(sieve(sieve(x0))) → ACTIVE(sieve(active(sieve(mark(x0)))))
MARK(if(0, y1, y2)) → ACTIVE(if(active(0), y1, y2))
MARK(head(if(x0, x1, x2))) → ACTIVE(head(active(if(mark(x0), x1, x2))))
MARK(if(y0, active(x1), x2)) → ACTIVE(if(mark(y0), x1, x2))
MARK(tail(sieve(x0))) → ACTIVE(tail(active(sieve(mark(x0)))))
MARK(head(primes)) → ACTIVE(head(active(primes)))
MARK(sieve(filter(x0, x1))) → ACTIVE(sieve(active(filter(mark(x0), mark(x1)))))
MARK(head(0)) → ACTIVE(head(active(0)))
MARK(head(tail(x0))) → ACTIVE(head(active(tail(mark(x0)))))
MARK(if(X1, X2, X3)) → MARK(X1)
MARK(head(cons(x0, x1))) → ACTIVE(head(active(cons(mark(x0), x1))))
MARK(sieve(x0)) → ACTIVE(sieve(x0))
ACTIVE(from(X)) → MARK(cons(X, from(s(X))))
MARK(filter(y0, true)) → ACTIVE(filter(mark(y0), active(true)))
MARK(filter(true, y1)) → ACTIVE(filter(active(true), mark(y1)))
MARK(head(x0)) → ACTIVE(head(x0))
MARK(tail(filter(x0, x1))) → ACTIVE(tail(active(filter(mark(x0), mark(x1)))))
MARK(head(head(x0))) → ACTIVE(head(active(head(mark(x0)))))
MARK(head(false)) → ACTIVE(head(active(false)))
MARK(tail(head(x0))) → ACTIVE(tail(active(head(mark(x0)))))
MARK(if(sieve(x0), y1, y2)) → ACTIVE(if(active(sieve(mark(x0))), y1, y2))
MARK(s(X)) → MARK(X)
MARK(filter(X1, X2)) → MARK(X2)
ACTIVE(sieve(cons(X, Y))) → MARK(cons(X, filter(X, sieve(Y))))
MARK(sieve(cons(x0, x1))) → ACTIVE(sieve(active(cons(mark(x0), x1))))
MARK(tail(false)) → ACTIVE(tail(active(false)))
MARK(filter(from(x0), y1)) → ACTIVE(filter(active(from(mark(x0))), mark(y1)))
MARK(filter(tail(x0), y1)) → ACTIVE(filter(active(tail(mark(x0))), mark(y1)))
MARK(tail(cons(x0, x1))) → ACTIVE(tail(active(cons(mark(x0), x1))))
MARK(tail(x0)) → ACTIVE(tail(x0))
MARK(filter(y0, cons(x0, x1))) → ACTIVE(filter(mark(y0), active(cons(mark(x0), x1))))
MARK(if(s(x0), y1, y2)) → ACTIVE(if(active(s(mark(x0))), y1, y2))
MARK(divides(X1, X2)) → MARK(X2)
MARK(filter(y0, sieve(x0))) → ACTIVE(filter(mark(y0), active(sieve(mark(x0)))))
MARK(divides(X1, X2)) → MARK(X1)
MARK(sieve(X)) → MARK(X)
MARK(head(sieve(x0))) → ACTIVE(head(active(sieve(mark(x0)))))
MARK(filter(y0, filter(x0, x1))) → ACTIVE(filter(mark(y0), active(filter(mark(x0), mark(x1)))))
MARK(filter(x0, y1)) → ACTIVE(filter(x0, mark(y1)))
ACTIVE(if(true, X, Y)) → MARK(X)
ACTIVE(tail(cons(X, Y))) → MARK(Y)
MARK(if(y0, x1, active(x2))) → ACTIVE(if(mark(y0), x1, x2))
MARK(tail(divides(x0, x1))) → ACTIVE(tail(active(divides(mark(x0), mark(x1)))))
MARK(filter(y0, from(x0))) → ACTIVE(filter(mark(y0), active(from(mark(x0)))))
MARK(tail(X)) → MARK(X)
MARK(head(X)) → MARK(X)
MARK(cons(X1, X2)) → MARK(X1)
MARK(tail(if(x0, x1, x2))) → ACTIVE(tail(active(if(mark(x0), x1, x2))))
ACTIVE(filter(s(s(X)), cons(Y, Z))) → MARK(if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y)))))
MARK(if(y0, x1, mark(x2))) → ACTIVE(if(mark(y0), x1, x2))
MARK(head(divides(x0, x1))) → ACTIVE(head(active(divides(mark(x0), mark(x1)))))
MARK(sieve(if(x0, x1, x2))) → ACTIVE(sieve(active(if(mark(x0), x1, x2))))
MARK(filter(y0, tail(x0))) → ACTIVE(filter(mark(y0), active(tail(mark(x0)))))
MARK(sieve(s(x0))) → ACTIVE(sieve(active(s(mark(x0)))))
MARK(sieve(primes)) → ACTIVE(sieve(active(primes)))
MARK(sieve(0)) → ACTIVE(sieve(active(0)))
MARK(filter(y0, if(x0, x1, x2))) → ACTIVE(filter(mark(y0), active(if(mark(x0), x1, x2))))
MARK(head(filter(x0, x1))) → ACTIVE(head(active(filter(mark(x0), mark(x1)))))
MARK(sieve(divides(x0, x1))) → ACTIVE(sieve(active(divides(mark(x0), mark(x1)))))
MARK(if(x0, x1, x2)) → ACTIVE(if(x0, x1, x2))
MARK(filter(sieve(x0), y1)) → ACTIVE(filter(active(sieve(mark(x0))), mark(y1)))
MARK(filter(y0, s(x0))) → ACTIVE(filter(mark(y0), active(s(mark(x0)))))
MARK(if(head(x0), y1, y2)) → ACTIVE(if(active(head(mark(x0))), y1, y2))
MARK(if(y0, mark(x1), x2)) → ACTIVE(if(mark(y0), x1, x2))
MARK(tail(s(x0))) → ACTIVE(tail(active(s(mark(x0)))))
MARK(if(if(x0, x1, x2), y1, y2)) → ACTIVE(if(active(if(mark(x0), x1, x2)), y1, y2))
MARK(tail(0)) → ACTIVE(tail(active(0)))
MARK(primes) → ACTIVE(primes)
MARK(tail(true)) → ACTIVE(tail(active(true)))
ACTIVE(if(false, X, Y)) → MARK(Y)
MARK(tail(primes)) → ACTIVE(tail(active(primes)))
MARK(filter(s(x0), y1)) → ACTIVE(filter(active(s(mark(x0))), mark(y1)))
MARK(if(primes, y1, y2)) → ACTIVE(if(active(primes), y1, y2))
MARK(if(true, y1, y2)) → ACTIVE(if(active(true), y1, y2))
MARK(if(tail(x0), y1, y2)) → ACTIVE(if(active(tail(mark(x0))), y1, y2))
MARK(sieve(tail(x0))) → ACTIVE(sieve(active(tail(mark(x0)))))
MARK(sieve(from(x0))) → ACTIVE(sieve(active(from(mark(x0)))))
MARK(filter(filter(x0, x1), y1)) → ACTIVE(filter(active(filter(mark(x0), mark(x1))), mark(y1)))
MARK(filter(y0, 0)) → ACTIVE(filter(mark(y0), active(0)))
MARK(filter(0, y1)) → ACTIVE(filter(active(0), mark(y1)))
MARK(if(filter(x0, x1), y1, y2)) → ACTIVE(if(active(filter(mark(x0), mark(x1))), y1, y2))
MARK(filter(head(x0), y1)) → ACTIVE(filter(active(head(mark(x0))), mark(y1)))
MARK(filter(divides(x0, x1), y1)) → ACTIVE(filter(active(divides(mark(x0), mark(x1))), mark(y1)))
MARK(from(X)) → MARK(X)
MARK(if(divides(x0, x1), y1, y2)) → ACTIVE(if(active(divides(mark(x0), mark(x1))), y1, y2))
MARK(head(from(x0))) → ACTIVE(head(active(from(mark(x0)))))
MARK(tail(tail(x0))) → ACTIVE(tail(active(tail(mark(x0)))))
MARK(if(cons(x0, x1), y1, y2)) → ACTIVE(if(active(cons(mark(x0), x1)), y1, y2))
MARK(sieve(false)) → ACTIVE(sieve(active(false)))
MARK(head(true)) → ACTIVE(head(active(true)))
MARK(sieve(true)) → ACTIVE(sieve(true))
ACTIVE(primes) → MARK(sieve(from(s(s(0)))))
MARK(filter(X1, X2)) → MARK(X1)
MARK(head(s(x0))) → ACTIVE(head(active(s(mark(x0)))))
MARK(if(false, y1, y2)) → ACTIVE(if(active(false), y1, y2))
MARK(filter(y0, head(x0))) → ACTIVE(filter(mark(y0), active(head(mark(x0)))))
MARK(filter(if(x0, x1, x2), y1)) → ACTIVE(filter(active(if(mark(x0), x1, x2)), mark(y1)))
MARK(from(X)) → ACTIVE(from(mark(X)))
ACTIVE(head(cons(X, Y))) → MARK(X)
MARK(sieve(head(x0))) → ACTIVE(sieve(active(head(mark(x0)))))
MARK(filter(false, y1)) → ACTIVE(filter(active(false), mark(y1)))
MARK(filter(y0, false)) → ACTIVE(filter(mark(y0), active(false)))
MARK(tail(from(x0))) → ACTIVE(tail(active(from(mark(x0)))))
MARK(filter(y0, primes)) → ACTIVE(filter(mark(y0), active(primes)))
MARK(filter(primes, y1)) → ACTIVE(filter(active(primes), mark(y1)))
MARK(if(from(x0), y1, y2)) → ACTIVE(if(active(from(mark(x0))), y1, y2))
MARK(filter(y0, divides(x0, x1))) → ACTIVE(filter(mark(y0), active(divides(mark(x0), mark(x1)))))
MARK(filter(cons(x0, x1), y1)) → ACTIVE(filter(active(cons(mark(x0), x1)), mark(y1)))

The TRS R consists of the following rules:

active(primes) → mark(sieve(from(s(s(0)))))
active(from(X)) → mark(cons(X, from(s(X))))
active(head(cons(X, Y))) → mark(X)
active(tail(cons(X, Y))) → mark(Y)
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(filter(s(s(X)), cons(Y, Z))) → mark(if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y)))))
active(sieve(cons(X, Y))) → mark(cons(X, filter(X, sieve(Y))))
mark(primes) → active(primes)
mark(sieve(X)) → active(sieve(mark(X)))
mark(from(X)) → active(from(mark(X)))
mark(s(X)) → active(s(mark(X)))
mark(0) → active(0)
mark(cons(X1, X2)) → active(cons(mark(X1), X2))
mark(head(X)) → active(head(mark(X)))
mark(tail(X)) → active(tail(mark(X)))
mark(if(X1, X2, X3)) → active(if(mark(X1), X2, X3))
mark(true) → active(true)
mark(false) → active(false)
mark(filter(X1, X2)) → active(filter(mark(X1), mark(X2)))
mark(divides(X1, X2)) → active(divides(mark(X1), mark(X2)))
sieve(mark(X)) → sieve(X)
sieve(active(X)) → sieve(X)
from(mark(X)) → from(X)
from(active(X)) → from(X)
s(mark(X)) → s(X)
s(active(X)) → s(X)
cons(mark(X1), X2) → cons(X1, X2)
cons(X1, mark(X2)) → cons(X1, X2)
cons(active(X1), X2) → cons(X1, X2)
cons(X1, active(X2)) → cons(X1, X2)
head(mark(X)) → head(X)
head(active(X)) → head(X)
tail(mark(X)) → tail(X)
tail(active(X)) → tail(X)
if(mark(X1), X2, X3) → if(X1, X2, X3)
if(X1, mark(X2), X3) → if(X1, X2, X3)
if(X1, X2, mark(X3)) → if(X1, X2, X3)
if(active(X1), X2, X3) → if(X1, X2, X3)
if(X1, active(X2), X3) → if(X1, X2, X3)
if(X1, X2, active(X3)) → if(X1, X2, X3)
filter(mark(X1), X2) → filter(X1, X2)
filter(X1, mark(X2)) → filter(X1, X2)
filter(active(X1), X2) → filter(X1, X2)
filter(X1, active(X2)) → filter(X1, X2)
divides(mark(X1), X2) → divides(X1, X2)
divides(X1, mark(X2)) → divides(X1, X2)
divides(active(X1), X2) → divides(X1, X2)
divides(X1, active(X2)) → divides(X1, X2)

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
The approximation of the Dependency Graph [15,17,22] contains 1 SCC with 1 less node.

↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
            ↳ QDPOrderProof
              ↳ QDP
                ↳ Narrowing
                  ↳ QDP
                    ↳ Narrowing
                      ↳ QDP
                        ↳ Narrowing
                          ↳ QDP
                            ↳ Narrowing
                              ↳ QDP
                                ↳ Narrowing
                                  ↳ QDP
                                    ↳ Narrowing
                                      ↳ QDP
                                        ↳ DependencyGraphProof
QDP
                                            ↳ Narrowing

Q DP problem:
The TRS P consists of the following rules:

MARK(filter(y0, x1)) → ACTIVE(filter(mark(y0), x1))
MARK(sieve(sieve(x0))) → ACTIVE(sieve(active(sieve(mark(x0)))))
MARK(if(0, y1, y2)) → ACTIVE(if(active(0), y1, y2))
MARK(head(if(x0, x1, x2))) → ACTIVE(head(active(if(mark(x0), x1, x2))))
MARK(if(y0, active(x1), x2)) → ACTIVE(if(mark(y0), x1, x2))
MARK(tail(sieve(x0))) → ACTIVE(tail(active(sieve(mark(x0)))))
MARK(head(primes)) → ACTIVE(head(active(primes)))
MARK(sieve(filter(x0, x1))) → ACTIVE(sieve(active(filter(mark(x0), mark(x1)))))
MARK(head(0)) → ACTIVE(head(active(0)))
MARK(head(tail(x0))) → ACTIVE(head(active(tail(mark(x0)))))
MARK(if(X1, X2, X3)) → MARK(X1)
MARK(head(cons(x0, x1))) → ACTIVE(head(active(cons(mark(x0), x1))))
MARK(sieve(x0)) → ACTIVE(sieve(x0))
ACTIVE(from(X)) → MARK(cons(X, from(s(X))))
MARK(filter(true, y1)) → ACTIVE(filter(active(true), mark(y1)))
MARK(filter(y0, true)) → ACTIVE(filter(mark(y0), active(true)))
MARK(head(x0)) → ACTIVE(head(x0))
MARK(tail(filter(x0, x1))) → ACTIVE(tail(active(filter(mark(x0), mark(x1)))))
MARK(head(head(x0))) → ACTIVE(head(active(head(mark(x0)))))
MARK(head(false)) → ACTIVE(head(active(false)))
MARK(tail(head(x0))) → ACTIVE(tail(active(head(mark(x0)))))
MARK(if(sieve(x0), y1, y2)) → ACTIVE(if(active(sieve(mark(x0))), y1, y2))
MARK(filter(X1, X2)) → MARK(X2)
MARK(s(X)) → MARK(X)
ACTIVE(sieve(cons(X, Y))) → MARK(cons(X, filter(X, sieve(Y))))
MARK(sieve(cons(x0, x1))) → ACTIVE(sieve(active(cons(mark(x0), x1))))
MARK(tail(false)) → ACTIVE(tail(active(false)))
MARK(filter(from(x0), y1)) → ACTIVE(filter(active(from(mark(x0))), mark(y1)))
MARK(filter(tail(x0), y1)) → ACTIVE(filter(active(tail(mark(x0))), mark(y1)))
MARK(tail(cons(x0, x1))) → ACTIVE(tail(active(cons(mark(x0), x1))))
MARK(tail(x0)) → ACTIVE(tail(x0))
MARK(filter(y0, cons(x0, x1))) → ACTIVE(filter(mark(y0), active(cons(mark(x0), x1))))
MARK(if(s(x0), y1, y2)) → ACTIVE(if(active(s(mark(x0))), y1, y2))
MARK(divides(X1, X2)) → MARK(X2)
MARK(filter(y0, sieve(x0))) → ACTIVE(filter(mark(y0), active(sieve(mark(x0)))))
MARK(divides(X1, X2)) → MARK(X1)
MARK(sieve(X)) → MARK(X)
MARK(head(sieve(x0))) → ACTIVE(head(active(sieve(mark(x0)))))
MARK(filter(y0, filter(x0, x1))) → ACTIVE(filter(mark(y0), active(filter(mark(x0), mark(x1)))))
ACTIVE(if(true, X, Y)) → MARK(X)
MARK(filter(x0, y1)) → ACTIVE(filter(x0, mark(y1)))
ACTIVE(tail(cons(X, Y))) → MARK(Y)
MARK(if(y0, x1, active(x2))) → ACTIVE(if(mark(y0), x1, x2))
MARK(tail(divides(x0, x1))) → ACTIVE(tail(active(divides(mark(x0), mark(x1)))))
MARK(filter(y0, from(x0))) → ACTIVE(filter(mark(y0), active(from(mark(x0)))))
MARK(tail(X)) → MARK(X)
MARK(head(X)) → MARK(X)
MARK(cons(X1, X2)) → MARK(X1)
MARK(tail(if(x0, x1, x2))) → ACTIVE(tail(active(if(mark(x0), x1, x2))))
MARK(if(y0, x1, mark(x2))) → ACTIVE(if(mark(y0), x1, x2))
ACTIVE(filter(s(s(X)), cons(Y, Z))) → MARK(if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y)))))
MARK(head(divides(x0, x1))) → ACTIVE(head(active(divides(mark(x0), mark(x1)))))
MARK(sieve(if(x0, x1, x2))) → ACTIVE(sieve(active(if(mark(x0), x1, x2))))
MARK(filter(y0, tail(x0))) → ACTIVE(filter(mark(y0), active(tail(mark(x0)))))
MARK(sieve(s(x0))) → ACTIVE(sieve(active(s(mark(x0)))))
MARK(sieve(primes)) → ACTIVE(sieve(active(primes)))
MARK(sieve(0)) → ACTIVE(sieve(active(0)))
MARK(filter(y0, if(x0, x1, x2))) → ACTIVE(filter(mark(y0), active(if(mark(x0), x1, x2))))
MARK(head(filter(x0, x1))) → ACTIVE(head(active(filter(mark(x0), mark(x1)))))
MARK(sieve(divides(x0, x1))) → ACTIVE(sieve(active(divides(mark(x0), mark(x1)))))
MARK(if(x0, x1, x2)) → ACTIVE(if(x0, x1, x2))
MARK(filter(sieve(x0), y1)) → ACTIVE(filter(active(sieve(mark(x0))), mark(y1)))
MARK(filter(y0, s(x0))) → ACTIVE(filter(mark(y0), active(s(mark(x0)))))
MARK(if(head(x0), y1, y2)) → ACTIVE(if(active(head(mark(x0))), y1, y2))
MARK(tail(s(x0))) → ACTIVE(tail(active(s(mark(x0)))))
MARK(if(y0, mark(x1), x2)) → ACTIVE(if(mark(y0), x1, x2))
MARK(tail(0)) → ACTIVE(tail(active(0)))
MARK(if(if(x0, x1, x2), y1, y2)) → ACTIVE(if(active(if(mark(x0), x1, x2)), y1, y2))
MARK(primes) → ACTIVE(primes)
MARK(tail(true)) → ACTIVE(tail(active(true)))
ACTIVE(if(false, X, Y)) → MARK(Y)
MARK(tail(primes)) → ACTIVE(tail(active(primes)))
MARK(if(primes, y1, y2)) → ACTIVE(if(active(primes), y1, y2))
MARK(if(true, y1, y2)) → ACTIVE(if(active(true), y1, y2))
MARK(filter(s(x0), y1)) → ACTIVE(filter(active(s(mark(x0))), mark(y1)))
MARK(if(tail(x0), y1, y2)) → ACTIVE(if(active(tail(mark(x0))), y1, y2))
MARK(sieve(tail(x0))) → ACTIVE(sieve(active(tail(mark(x0)))))
MARK(sieve(from(x0))) → ACTIVE(sieve(active(from(mark(x0)))))
MARK(filter(filter(x0, x1), y1)) → ACTIVE(filter(active(filter(mark(x0), mark(x1))), mark(y1)))
MARK(filter(0, y1)) → ACTIVE(filter(active(0), mark(y1)))
MARK(filter(y0, 0)) → ACTIVE(filter(mark(y0), active(0)))
MARK(if(filter(x0, x1), y1, y2)) → ACTIVE(if(active(filter(mark(x0), mark(x1))), y1, y2))
MARK(filter(head(x0), y1)) → ACTIVE(filter(active(head(mark(x0))), mark(y1)))
MARK(filter(divides(x0, x1), y1)) → ACTIVE(filter(active(divides(mark(x0), mark(x1))), mark(y1)))
MARK(from(X)) → MARK(X)
MARK(if(divides(x0, x1), y1, y2)) → ACTIVE(if(active(divides(mark(x0), mark(x1))), y1, y2))
MARK(head(from(x0))) → ACTIVE(head(active(from(mark(x0)))))
MARK(tail(tail(x0))) → ACTIVE(tail(active(tail(mark(x0)))))
MARK(if(cons(x0, x1), y1, y2)) → ACTIVE(if(active(cons(mark(x0), x1)), y1, y2))
MARK(sieve(false)) → ACTIVE(sieve(active(false)))
MARK(head(true)) → ACTIVE(head(active(true)))
ACTIVE(primes) → MARK(sieve(from(s(s(0)))))
MARK(filter(X1, X2)) → MARK(X1)
MARK(head(s(x0))) → ACTIVE(head(active(s(mark(x0)))))
MARK(if(false, y1, y2)) → ACTIVE(if(active(false), y1, y2))
MARK(filter(y0, head(x0))) → ACTIVE(filter(mark(y0), active(head(mark(x0)))))
MARK(filter(if(x0, x1, x2), y1)) → ACTIVE(filter(active(if(mark(x0), x1, x2)), mark(y1)))
MARK(from(X)) → ACTIVE(from(mark(X)))
MARK(sieve(head(x0))) → ACTIVE(sieve(active(head(mark(x0)))))
ACTIVE(head(cons(X, Y))) → MARK(X)
MARK(tail(from(x0))) → ACTIVE(tail(active(from(mark(x0)))))
MARK(filter(y0, false)) → ACTIVE(filter(mark(y0), active(false)))
MARK(filter(false, y1)) → ACTIVE(filter(active(false), mark(y1)))
MARK(filter(primes, y1)) → ACTIVE(filter(active(primes), mark(y1)))
MARK(filter(y0, primes)) → ACTIVE(filter(mark(y0), active(primes)))
MARK(if(from(x0), y1, y2)) → ACTIVE(if(active(from(mark(x0))), y1, y2))
MARK(filter(y0, divides(x0, x1))) → ACTIVE(filter(mark(y0), active(divides(mark(x0), mark(x1)))))
MARK(filter(cons(x0, x1), y1)) → ACTIVE(filter(active(cons(mark(x0), x1)), mark(y1)))

The TRS R consists of the following rules:

active(primes) → mark(sieve(from(s(s(0)))))
active(from(X)) → mark(cons(X, from(s(X))))
active(head(cons(X, Y))) → mark(X)
active(tail(cons(X, Y))) → mark(Y)
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(filter(s(s(X)), cons(Y, Z))) → mark(if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y)))))
active(sieve(cons(X, Y))) → mark(cons(X, filter(X, sieve(Y))))
mark(primes) → active(primes)
mark(sieve(X)) → active(sieve(mark(X)))
mark(from(X)) → active(from(mark(X)))
mark(s(X)) → active(s(mark(X)))
mark(0) → active(0)
mark(cons(X1, X2)) → active(cons(mark(X1), X2))
mark(head(X)) → active(head(mark(X)))
mark(tail(X)) → active(tail(mark(X)))
mark(if(X1, X2, X3)) → active(if(mark(X1), X2, X3))
mark(true) → active(true)
mark(false) → active(false)
mark(filter(X1, X2)) → active(filter(mark(X1), mark(X2)))
mark(divides(X1, X2)) → active(divides(mark(X1), mark(X2)))
sieve(mark(X)) → sieve(X)
sieve(active(X)) → sieve(X)
from(mark(X)) → from(X)
from(active(X)) → from(X)
s(mark(X)) → s(X)
s(active(X)) → s(X)
cons(mark(X1), X2) → cons(X1, X2)
cons(X1, mark(X2)) → cons(X1, X2)
cons(active(X1), X2) → cons(X1, X2)
cons(X1, active(X2)) → cons(X1, X2)
head(mark(X)) → head(X)
head(active(X)) → head(X)
tail(mark(X)) → tail(X)
tail(active(X)) → tail(X)
if(mark(X1), X2, X3) → if(X1, X2, X3)
if(X1, mark(X2), X3) → if(X1, X2, X3)
if(X1, X2, mark(X3)) → if(X1, X2, X3)
if(active(X1), X2, X3) → if(X1, X2, X3)
if(X1, active(X2), X3) → if(X1, X2, X3)
if(X1, X2, active(X3)) → if(X1, X2, X3)
filter(mark(X1), X2) → filter(X1, X2)
filter(X1, mark(X2)) → filter(X1, X2)
filter(active(X1), X2) → filter(X1, X2)
filter(X1, active(X2)) → filter(X1, X2)
divides(mark(X1), X2) → divides(X1, X2)
divides(X1, mark(X2)) → divides(X1, X2)
divides(active(X1), X2) → divides(X1, X2)
divides(X1, active(X2)) → divides(X1, X2)

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
By narrowing [15] the rule MARK(sieve(0)) → ACTIVE(sieve(active(0))) at position [0] we obtained the following new rules:

MARK(sieve(0)) → ACTIVE(sieve(0))



↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
            ↳ QDPOrderProof
              ↳ QDP
                ↳ Narrowing
                  ↳ QDP
                    ↳ Narrowing
                      ↳ QDP
                        ↳ Narrowing
                          ↳ QDP
                            ↳ Narrowing
                              ↳ QDP
                                ↳ Narrowing
                                  ↳ QDP
                                    ↳ Narrowing
                                      ↳ QDP
                                        ↳ DependencyGraphProof
                                          ↳ QDP
                                            ↳ Narrowing
QDP
                                                ↳ DependencyGraphProof

Q DP problem:
The TRS P consists of the following rules:

MARK(filter(y0, x1)) → ACTIVE(filter(mark(y0), x1))
MARK(sieve(sieve(x0))) → ACTIVE(sieve(active(sieve(mark(x0)))))
MARK(head(if(x0, x1, x2))) → ACTIVE(head(active(if(mark(x0), x1, x2))))
MARK(if(0, y1, y2)) → ACTIVE(if(active(0), y1, y2))
MARK(if(y0, active(x1), x2)) → ACTIVE(if(mark(y0), x1, x2))
MARK(tail(sieve(x0))) → ACTIVE(tail(active(sieve(mark(x0)))))
MARK(head(primes)) → ACTIVE(head(active(primes)))
MARK(sieve(filter(x0, x1))) → ACTIVE(sieve(active(filter(mark(x0), mark(x1)))))
MARK(head(tail(x0))) → ACTIVE(head(active(tail(mark(x0)))))
MARK(head(0)) → ACTIVE(head(active(0)))
MARK(if(X1, X2, X3)) → MARK(X1)
MARK(head(cons(x0, x1))) → ACTIVE(head(active(cons(mark(x0), x1))))
MARK(sieve(x0)) → ACTIVE(sieve(x0))
ACTIVE(from(X)) → MARK(cons(X, from(s(X))))
MARK(filter(y0, true)) → ACTIVE(filter(mark(y0), active(true)))
MARK(filter(true, y1)) → ACTIVE(filter(active(true), mark(y1)))
MARK(head(x0)) → ACTIVE(head(x0))
MARK(tail(filter(x0, x1))) → ACTIVE(tail(active(filter(mark(x0), mark(x1)))))
MARK(head(head(x0))) → ACTIVE(head(active(head(mark(x0)))))
MARK(head(false)) → ACTIVE(head(active(false)))
MARK(tail(head(x0))) → ACTIVE(tail(active(head(mark(x0)))))
MARK(if(sieve(x0), y1, y2)) → ACTIVE(if(active(sieve(mark(x0))), y1, y2))
MARK(s(X)) → MARK(X)
MARK(filter(X1, X2)) → MARK(X2)
ACTIVE(sieve(cons(X, Y))) → MARK(cons(X, filter(X, sieve(Y))))
MARK(sieve(cons(x0, x1))) → ACTIVE(sieve(active(cons(mark(x0), x1))))
MARK(tail(false)) → ACTIVE(tail(active(false)))
MARK(filter(from(x0), y1)) → ACTIVE(filter(active(from(mark(x0))), mark(y1)))
MARK(filter(tail(x0), y1)) → ACTIVE(filter(active(tail(mark(x0))), mark(y1)))
MARK(tail(cons(x0, x1))) → ACTIVE(tail(active(cons(mark(x0), x1))))
MARK(tail(x0)) → ACTIVE(tail(x0))
MARK(filter(y0, cons(x0, x1))) → ACTIVE(filter(mark(y0), active(cons(mark(x0), x1))))
MARK(if(s(x0), y1, y2)) → ACTIVE(if(active(s(mark(x0))), y1, y2))
MARK(divides(X1, X2)) → MARK(X2)
MARK(filter(y0, sieve(x0))) → ACTIVE(filter(mark(y0), active(sieve(mark(x0)))))
MARK(divides(X1, X2)) → MARK(X1)
MARK(head(sieve(x0))) → ACTIVE(head(active(sieve(mark(x0)))))
MARK(sieve(X)) → MARK(X)
MARK(filter(y0, filter(x0, x1))) → ACTIVE(filter(mark(y0), active(filter(mark(x0), mark(x1)))))
MARK(filter(x0, y1)) → ACTIVE(filter(x0, mark(y1)))
ACTIVE(if(true, X, Y)) → MARK(X)
MARK(if(y0, x1, active(x2))) → ACTIVE(if(mark(y0), x1, x2))
ACTIVE(tail(cons(X, Y))) → MARK(Y)
MARK(tail(divides(x0, x1))) → ACTIVE(tail(active(divides(mark(x0), mark(x1)))))
MARK(filter(y0, from(x0))) → ACTIVE(filter(mark(y0), active(from(mark(x0)))))
MARK(head(X)) → MARK(X)
MARK(tail(X)) → MARK(X)
MARK(cons(X1, X2)) → MARK(X1)
MARK(tail(if(x0, x1, x2))) → ACTIVE(tail(active(if(mark(x0), x1, x2))))
MARK(head(divides(x0, x1))) → ACTIVE(head(active(divides(mark(x0), mark(x1)))))
ACTIVE(filter(s(s(X)), cons(Y, Z))) → MARK(if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y)))))
MARK(if(y0, x1, mark(x2))) → ACTIVE(if(mark(y0), x1, x2))
MARK(sieve(if(x0, x1, x2))) → ACTIVE(sieve(active(if(mark(x0), x1, x2))))
MARK(filter(y0, tail(x0))) → ACTIVE(filter(mark(y0), active(tail(mark(x0)))))
MARK(sieve(s(x0))) → ACTIVE(sieve(active(s(mark(x0)))))
MARK(sieve(primes)) → ACTIVE(sieve(active(primes)))
MARK(filter(y0, if(x0, x1, x2))) → ACTIVE(filter(mark(y0), active(if(mark(x0), x1, x2))))
MARK(head(filter(x0, x1))) → ACTIVE(head(active(filter(mark(x0), mark(x1)))))
MARK(sieve(divides(x0, x1))) → ACTIVE(sieve(active(divides(mark(x0), mark(x1)))))
MARK(if(x0, x1, x2)) → ACTIVE(if(x0, x1, x2))
MARK(filter(sieve(x0), y1)) → ACTIVE(filter(active(sieve(mark(x0))), mark(y1)))
MARK(filter(y0, s(x0))) → ACTIVE(filter(mark(y0), active(s(mark(x0)))))
MARK(if(head(x0), y1, y2)) → ACTIVE(if(active(head(mark(x0))), y1, y2))
MARK(if(y0, mark(x1), x2)) → ACTIVE(if(mark(y0), x1, x2))
MARK(tail(s(x0))) → ACTIVE(tail(active(s(mark(x0)))))
MARK(if(if(x0, x1, x2), y1, y2)) → ACTIVE(if(active(if(mark(x0), x1, x2)), y1, y2))
MARK(tail(0)) → ACTIVE(tail(active(0)))
MARK(primes) → ACTIVE(primes)
MARK(tail(true)) → ACTIVE(tail(active(true)))
ACTIVE(if(false, X, Y)) → MARK(Y)
MARK(tail(primes)) → ACTIVE(tail(active(primes)))
MARK(filter(s(x0), y1)) → ACTIVE(filter(active(s(mark(x0))), mark(y1)))
MARK(if(true, y1, y2)) → ACTIVE(if(active(true), y1, y2))
MARK(if(primes, y1, y2)) → ACTIVE(if(active(primes), y1, y2))
MARK(sieve(tail(x0))) → ACTIVE(sieve(active(tail(mark(x0)))))
MARK(if(tail(x0), y1, y2)) → ACTIVE(if(active(tail(mark(x0))), y1, y2))
MARK(sieve(from(x0))) → ACTIVE(sieve(active(from(mark(x0)))))
MARK(filter(filter(x0, x1), y1)) → ACTIVE(filter(active(filter(mark(x0), mark(x1))), mark(y1)))
MARK(filter(y0, 0)) → ACTIVE(filter(mark(y0), active(0)))
MARK(filter(0, y1)) → ACTIVE(filter(active(0), mark(y1)))
MARK(if(filter(x0, x1), y1, y2)) → ACTIVE(if(active(filter(mark(x0), mark(x1))), y1, y2))
MARK(filter(head(x0), y1)) → ACTIVE(filter(active(head(mark(x0))), mark(y1)))
MARK(filter(divides(x0, x1), y1)) → ACTIVE(filter(active(divides(mark(x0), mark(x1))), mark(y1)))
MARK(from(X)) → MARK(X)
MARK(if(divides(x0, x1), y1, y2)) → ACTIVE(if(active(divides(mark(x0), mark(x1))), y1, y2))
MARK(tail(tail(x0))) → ACTIVE(tail(active(tail(mark(x0)))))
MARK(head(from(x0))) → ACTIVE(head(active(from(mark(x0)))))
MARK(head(true)) → ACTIVE(head(active(true)))
MARK(sieve(false)) → ACTIVE(sieve(active(false)))
MARK(if(cons(x0, x1), y1, y2)) → ACTIVE(if(active(cons(mark(x0), x1)), y1, y2))
ACTIVE(primes) → MARK(sieve(from(s(s(0)))))
MARK(filter(X1, X2)) → MARK(X1)
MARK(sieve(0)) → ACTIVE(sieve(0))
MARK(head(s(x0))) → ACTIVE(head(active(s(mark(x0)))))
MARK(if(false, y1, y2)) → ACTIVE(if(active(false), y1, y2))
MARK(filter(y0, head(x0))) → ACTIVE(filter(mark(y0), active(head(mark(x0)))))
MARK(filter(if(x0, x1, x2), y1)) → ACTIVE(filter(active(if(mark(x0), x1, x2)), mark(y1)))
MARK(from(X)) → ACTIVE(from(mark(X)))
ACTIVE(head(cons(X, Y))) → MARK(X)
MARK(sieve(head(x0))) → ACTIVE(sieve(active(head(mark(x0)))))
MARK(filter(false, y1)) → ACTIVE(filter(active(false), mark(y1)))
MARK(filter(y0, false)) → ACTIVE(filter(mark(y0), active(false)))
MARK(tail(from(x0))) → ACTIVE(tail(active(from(mark(x0)))))
MARK(filter(y0, primes)) → ACTIVE(filter(mark(y0), active(primes)))
MARK(filter(primes, y1)) → ACTIVE(filter(active(primes), mark(y1)))
MARK(if(from(x0), y1, y2)) → ACTIVE(if(active(from(mark(x0))), y1, y2))
MARK(filter(y0, divides(x0, x1))) → ACTIVE(filter(mark(y0), active(divides(mark(x0), mark(x1)))))
MARK(filter(cons(x0, x1), y1)) → ACTIVE(filter(active(cons(mark(x0), x1)), mark(y1)))

The TRS R consists of the following rules:

active(primes) → mark(sieve(from(s(s(0)))))
active(from(X)) → mark(cons(X, from(s(X))))
active(head(cons(X, Y))) → mark(X)
active(tail(cons(X, Y))) → mark(Y)
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(filter(s(s(X)), cons(Y, Z))) → mark(if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y)))))
active(sieve(cons(X, Y))) → mark(cons(X, filter(X, sieve(Y))))
mark(primes) → active(primes)
mark(sieve(X)) → active(sieve(mark(X)))
mark(from(X)) → active(from(mark(X)))
mark(s(X)) → active(s(mark(X)))
mark(0) → active(0)
mark(cons(X1, X2)) → active(cons(mark(X1), X2))
mark(head(X)) → active(head(mark(X)))
mark(tail(X)) → active(tail(mark(X)))
mark(if(X1, X2, X3)) → active(if(mark(X1), X2, X3))
mark(true) → active(true)
mark(false) → active(false)
mark(filter(X1, X2)) → active(filter(mark(X1), mark(X2)))
mark(divides(X1, X2)) → active(divides(mark(X1), mark(X2)))
sieve(mark(X)) → sieve(X)
sieve(active(X)) → sieve(X)
from(mark(X)) → from(X)
from(active(X)) → from(X)
s(mark(X)) → s(X)
s(active(X)) → s(X)
cons(mark(X1), X2) → cons(X1, X2)
cons(X1, mark(X2)) → cons(X1, X2)
cons(active(X1), X2) → cons(X1, X2)
cons(X1, active(X2)) → cons(X1, X2)
head(mark(X)) → head(X)
head(active(X)) → head(X)
tail(mark(X)) → tail(X)
tail(active(X)) → tail(X)
if(mark(X1), X2, X3) → if(X1, X2, X3)
if(X1, mark(X2), X3) → if(X1, X2, X3)
if(X1, X2, mark(X3)) → if(X1, X2, X3)
if(active(X1), X2, X3) → if(X1, X2, X3)
if(X1, active(X2), X3) → if(X1, X2, X3)
if(X1, X2, active(X3)) → if(X1, X2, X3)
filter(mark(X1), X2) → filter(X1, X2)
filter(X1, mark(X2)) → filter(X1, X2)
filter(active(X1), X2) → filter(X1, X2)
filter(X1, active(X2)) → filter(X1, X2)
divides(mark(X1), X2) → divides(X1, X2)
divides(X1, mark(X2)) → divides(X1, X2)
divides(active(X1), X2) → divides(X1, X2)
divides(X1, active(X2)) → divides(X1, X2)

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
The approximation of the Dependency Graph [15,17,22] contains 1 SCC with 1 less node.

↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
            ↳ QDPOrderProof
              ↳ QDP
                ↳ Narrowing
                  ↳ QDP
                    ↳ Narrowing
                      ↳ QDP
                        ↳ Narrowing
                          ↳ QDP
                            ↳ Narrowing
                              ↳ QDP
                                ↳ Narrowing
                                  ↳ QDP
                                    ↳ Narrowing
                                      ↳ QDP
                                        ↳ DependencyGraphProof
                                          ↳ QDP
                                            ↳ Narrowing
                                              ↳ QDP
                                                ↳ DependencyGraphProof
QDP
                                                    ↳ Narrowing

Q DP problem:
The TRS P consists of the following rules:

MARK(filter(y0, x1)) → ACTIVE(filter(mark(y0), x1))
MARK(sieve(sieve(x0))) → ACTIVE(sieve(active(sieve(mark(x0)))))
MARK(if(0, y1, y2)) → ACTIVE(if(active(0), y1, y2))
MARK(head(if(x0, x1, x2))) → ACTIVE(head(active(if(mark(x0), x1, x2))))
MARK(if(y0, active(x1), x2)) → ACTIVE(if(mark(y0), x1, x2))
MARK(tail(sieve(x0))) → ACTIVE(tail(active(sieve(mark(x0)))))
MARK(head(primes)) → ACTIVE(head(active(primes)))
MARK(sieve(filter(x0, x1))) → ACTIVE(sieve(active(filter(mark(x0), mark(x1)))))
MARK(head(0)) → ACTIVE(head(active(0)))
MARK(head(tail(x0))) → ACTIVE(head(active(tail(mark(x0)))))
MARK(if(X1, X2, X3)) → MARK(X1)
MARK(head(cons(x0, x1))) → ACTIVE(head(active(cons(mark(x0), x1))))
MARK(sieve(x0)) → ACTIVE(sieve(x0))
ACTIVE(from(X)) → MARK(cons(X, from(s(X))))
MARK(filter(true, y1)) → ACTIVE(filter(active(true), mark(y1)))
MARK(filter(y0, true)) → ACTIVE(filter(mark(y0), active(true)))
MARK(head(x0)) → ACTIVE(head(x0))
MARK(tail(filter(x0, x1))) → ACTIVE(tail(active(filter(mark(x0), mark(x1)))))
MARK(head(head(x0))) → ACTIVE(head(active(head(mark(x0)))))
MARK(head(false)) → ACTIVE(head(active(false)))
MARK(tail(head(x0))) → ACTIVE(tail(active(head(mark(x0)))))
MARK(if(sieve(x0), y1, y2)) → ACTIVE(if(active(sieve(mark(x0))), y1, y2))
MARK(s(X)) → MARK(X)
MARK(filter(X1, X2)) → MARK(X2)
ACTIVE(sieve(cons(X, Y))) → MARK(cons(X, filter(X, sieve(Y))))
MARK(sieve(cons(x0, x1))) → ACTIVE(sieve(active(cons(mark(x0), x1))))
MARK(tail(false)) → ACTIVE(tail(active(false)))
MARK(filter(from(x0), y1)) → ACTIVE(filter(active(from(mark(x0))), mark(y1)))
MARK(filter(tail(x0), y1)) → ACTIVE(filter(active(tail(mark(x0))), mark(y1)))
MARK(tail(cons(x0, x1))) → ACTIVE(tail(active(cons(mark(x0), x1))))
MARK(tail(x0)) → ACTIVE(tail(x0))
MARK(filter(y0, cons(x0, x1))) → ACTIVE(filter(mark(y0), active(cons(mark(x0), x1))))
MARK(if(s(x0), y1, y2)) → ACTIVE(if(active(s(mark(x0))), y1, y2))
MARK(divides(X1, X2)) → MARK(X2)
MARK(filter(y0, sieve(x0))) → ACTIVE(filter(mark(y0), active(sieve(mark(x0)))))
MARK(divides(X1, X2)) → MARK(X1)
MARK(sieve(X)) → MARK(X)
MARK(head(sieve(x0))) → ACTIVE(head(active(sieve(mark(x0)))))
MARK(filter(y0, filter(x0, x1))) → ACTIVE(filter(mark(y0), active(filter(mark(x0), mark(x1)))))
ACTIVE(if(true, X, Y)) → MARK(X)
MARK(filter(x0, y1)) → ACTIVE(filter(x0, mark(y1)))
ACTIVE(tail(cons(X, Y))) → MARK(Y)
MARK(if(y0, x1, active(x2))) → ACTIVE(if(mark(y0), x1, x2))
MARK(tail(divides(x0, x1))) → ACTIVE(tail(active(divides(mark(x0), mark(x1)))))
MARK(filter(y0, from(x0))) → ACTIVE(filter(mark(y0), active(from(mark(x0)))))
MARK(tail(X)) → MARK(X)
MARK(head(X)) → MARK(X)
MARK(cons(X1, X2)) → MARK(X1)
MARK(tail(if(x0, x1, x2))) → ACTIVE(tail(active(if(mark(x0), x1, x2))))
MARK(if(y0, x1, mark(x2))) → ACTIVE(if(mark(y0), x1, x2))
ACTIVE(filter(s(s(X)), cons(Y, Z))) → MARK(if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y)))))
MARK(head(divides(x0, x1))) → ACTIVE(head(active(divides(mark(x0), mark(x1)))))
MARK(sieve(if(x0, x1, x2))) → ACTIVE(sieve(active(if(mark(x0), x1, x2))))
MARK(filter(y0, tail(x0))) → ACTIVE(filter(mark(y0), active(tail(mark(x0)))))
MARK(sieve(s(x0))) → ACTIVE(sieve(active(s(mark(x0)))))
MARK(sieve(primes)) → ACTIVE(sieve(active(primes)))
MARK(filter(y0, if(x0, x1, x2))) → ACTIVE(filter(mark(y0), active(if(mark(x0), x1, x2))))
MARK(head(filter(x0, x1))) → ACTIVE(head(active(filter(mark(x0), mark(x1)))))
MARK(sieve(divides(x0, x1))) → ACTIVE(sieve(active(divides(mark(x0), mark(x1)))))
MARK(if(x0, x1, x2)) → ACTIVE(if(x0, x1, x2))
MARK(filter(sieve(x0), y1)) → ACTIVE(filter(active(sieve(mark(x0))), mark(y1)))
MARK(filter(y0, s(x0))) → ACTIVE(filter(mark(y0), active(s(mark(x0)))))
MARK(if(head(x0), y1, y2)) → ACTIVE(if(active(head(mark(x0))), y1, y2))
MARK(tail(s(x0))) → ACTIVE(tail(active(s(mark(x0)))))
MARK(if(y0, mark(x1), x2)) → ACTIVE(if(mark(y0), x1, x2))
MARK(tail(0)) → ACTIVE(tail(active(0)))
MARK(if(if(x0, x1, x2), y1, y2)) → ACTIVE(if(active(if(mark(x0), x1, x2)), y1, y2))
MARK(primes) → ACTIVE(primes)
MARK(tail(true)) → ACTIVE(tail(active(true)))
ACTIVE(if(false, X, Y)) → MARK(Y)
MARK(tail(primes)) → ACTIVE(tail(active(primes)))
MARK(if(primes, y1, y2)) → ACTIVE(if(active(primes), y1, y2))
MARK(if(true, y1, y2)) → ACTIVE(if(active(true), y1, y2))
MARK(filter(s(x0), y1)) → ACTIVE(filter(active(s(mark(x0))), mark(y1)))
MARK(if(tail(x0), y1, y2)) → ACTIVE(if(active(tail(mark(x0))), y1, y2))
MARK(sieve(tail(x0))) → ACTIVE(sieve(active(tail(mark(x0)))))
MARK(sieve(from(x0))) → ACTIVE(sieve(active(from(mark(x0)))))
MARK(filter(filter(x0, x1), y1)) → ACTIVE(filter(active(filter(mark(x0), mark(x1))), mark(y1)))
MARK(filter(0, y1)) → ACTIVE(filter(active(0), mark(y1)))
MARK(filter(y0, 0)) → ACTIVE(filter(mark(y0), active(0)))
MARK(if(filter(x0, x1), y1, y2)) → ACTIVE(if(active(filter(mark(x0), mark(x1))), y1, y2))
MARK(filter(head(x0), y1)) → ACTIVE(filter(active(head(mark(x0))), mark(y1)))
MARK(filter(divides(x0, x1), y1)) → ACTIVE(filter(active(divides(mark(x0), mark(x1))), mark(y1)))
MARK(from(X)) → MARK(X)
MARK(if(divides(x0, x1), y1, y2)) → ACTIVE(if(active(divides(mark(x0), mark(x1))), y1, y2))
MARK(head(from(x0))) → ACTIVE(head(active(from(mark(x0)))))
MARK(tail(tail(x0))) → ACTIVE(tail(active(tail(mark(x0)))))
MARK(if(cons(x0, x1), y1, y2)) → ACTIVE(if(active(cons(mark(x0), x1)), y1, y2))
MARK(sieve(false)) → ACTIVE(sieve(active(false)))
MARK(head(true)) → ACTIVE(head(active(true)))
ACTIVE(primes) → MARK(sieve(from(s(s(0)))))
MARK(filter(X1, X2)) → MARK(X1)
MARK(head(s(x0))) → ACTIVE(head(active(s(mark(x0)))))
MARK(if(false, y1, y2)) → ACTIVE(if(active(false), y1, y2))
MARK(filter(y0, head(x0))) → ACTIVE(filter(mark(y0), active(head(mark(x0)))))
MARK(filter(if(x0, x1, x2), y1)) → ACTIVE(filter(active(if(mark(x0), x1, x2)), mark(y1)))
MARK(from(X)) → ACTIVE(from(mark(X)))
MARK(sieve(head(x0))) → ACTIVE(sieve(active(head(mark(x0)))))
ACTIVE(head(cons(X, Y))) → MARK(X)
MARK(tail(from(x0))) → ACTIVE(tail(active(from(mark(x0)))))
MARK(filter(y0, false)) → ACTIVE(filter(mark(y0), active(false)))
MARK(filter(false, y1)) → ACTIVE(filter(active(false), mark(y1)))
MARK(filter(primes, y1)) → ACTIVE(filter(active(primes), mark(y1)))
MARK(filter(y0, primes)) → ACTIVE(filter(mark(y0), active(primes)))
MARK(if(from(x0), y1, y2)) → ACTIVE(if(active(from(mark(x0))), y1, y2))
MARK(filter(y0, divides(x0, x1))) → ACTIVE(filter(mark(y0), active(divides(mark(x0), mark(x1)))))
MARK(filter(cons(x0, x1), y1)) → ACTIVE(filter(active(cons(mark(x0), x1)), mark(y1)))

The TRS R consists of the following rules:

active(primes) → mark(sieve(from(s(s(0)))))
active(from(X)) → mark(cons(X, from(s(X))))
active(head(cons(X, Y))) → mark(X)
active(tail(cons(X, Y))) → mark(Y)
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(filter(s(s(X)), cons(Y, Z))) → mark(if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y)))))
active(sieve(cons(X, Y))) → mark(cons(X, filter(X, sieve(Y))))
mark(primes) → active(primes)
mark(sieve(X)) → active(sieve(mark(X)))
mark(from(X)) → active(from(mark(X)))
mark(s(X)) → active(s(mark(X)))
mark(0) → active(0)
mark(cons(X1, X2)) → active(cons(mark(X1), X2))
mark(head(X)) → active(head(mark(X)))
mark(tail(X)) → active(tail(mark(X)))
mark(if(X1, X2, X3)) → active(if(mark(X1), X2, X3))
mark(true) → active(true)
mark(false) → active(false)
mark(filter(X1, X2)) → active(filter(mark(X1), mark(X2)))
mark(divides(X1, X2)) → active(divides(mark(X1), mark(X2)))
sieve(mark(X)) → sieve(X)
sieve(active(X)) → sieve(X)
from(mark(X)) → from(X)
from(active(X)) → from(X)
s(mark(X)) → s(X)
s(active(X)) → s(X)
cons(mark(X1), X2) → cons(X1, X2)
cons(X1, mark(X2)) → cons(X1, X2)
cons(active(X1), X2) → cons(X1, X2)
cons(X1, active(X2)) → cons(X1, X2)
head(mark(X)) → head(X)
head(active(X)) → head(X)
tail(mark(X)) → tail(X)
tail(active(X)) → tail(X)
if(mark(X1), X2, X3) → if(X1, X2, X3)
if(X1, mark(X2), X3) → if(X1, X2, X3)
if(X1, X2, mark(X3)) → if(X1, X2, X3)
if(active(X1), X2, X3) → if(X1, X2, X3)
if(X1, active(X2), X3) → if(X1, X2, X3)
if(X1, X2, active(X3)) → if(X1, X2, X3)
filter(mark(X1), X2) → filter(X1, X2)
filter(X1, mark(X2)) → filter(X1, X2)
filter(active(X1), X2) → filter(X1, X2)
filter(X1, active(X2)) → filter(X1, X2)
divides(mark(X1), X2) → divides(X1, X2)
divides(X1, mark(X2)) → divides(X1, X2)
divides(active(X1), X2) → divides(X1, X2)
divides(X1, active(X2)) → divides(X1, X2)

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
By narrowing [15] the rule MARK(sieve(false)) → ACTIVE(sieve(active(false))) at position [0] we obtained the following new rules:

MARK(sieve(false)) → ACTIVE(sieve(false))



↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
            ↳ QDPOrderProof
              ↳ QDP
                ↳ Narrowing
                  ↳ QDP
                    ↳ Narrowing
                      ↳ QDP
                        ↳ Narrowing
                          ↳ QDP
                            ↳ Narrowing
                              ↳ QDP
                                ↳ Narrowing
                                  ↳ QDP
                                    ↳ Narrowing
                                      ↳ QDP
                                        ↳ DependencyGraphProof
                                          ↳ QDP
                                            ↳ Narrowing
                                              ↳ QDP
                                                ↳ DependencyGraphProof
                                                  ↳ QDP
                                                    ↳ Narrowing
QDP
                                                        ↳ DependencyGraphProof

Q DP problem:
The TRS P consists of the following rules:

MARK(filter(y0, x1)) → ACTIVE(filter(mark(y0), x1))
MARK(sieve(sieve(x0))) → ACTIVE(sieve(active(sieve(mark(x0)))))
MARK(head(if(x0, x1, x2))) → ACTIVE(head(active(if(mark(x0), x1, x2))))
MARK(if(0, y1, y2)) → ACTIVE(if(active(0), y1, y2))
MARK(if(y0, active(x1), x2)) → ACTIVE(if(mark(y0), x1, x2))
MARK(tail(sieve(x0))) → ACTIVE(tail(active(sieve(mark(x0)))))
MARK(head(primes)) → ACTIVE(head(active(primes)))
MARK(sieve(filter(x0, x1))) → ACTIVE(sieve(active(filter(mark(x0), mark(x1)))))
MARK(head(tail(x0))) → ACTIVE(head(active(tail(mark(x0)))))
MARK(head(0)) → ACTIVE(head(active(0)))
MARK(if(X1, X2, X3)) → MARK(X1)
MARK(head(cons(x0, x1))) → ACTIVE(head(active(cons(mark(x0), x1))))
MARK(sieve(x0)) → ACTIVE(sieve(x0))
ACTIVE(from(X)) → MARK(cons(X, from(s(X))))
MARK(filter(y0, true)) → ACTIVE(filter(mark(y0), active(true)))
MARK(filter(true, y1)) → ACTIVE(filter(active(true), mark(y1)))
MARK(head(x0)) → ACTIVE(head(x0))
MARK(tail(filter(x0, x1))) → ACTIVE(tail(active(filter(mark(x0), mark(x1)))))
MARK(head(head(x0))) → ACTIVE(head(active(head(mark(x0)))))
MARK(head(false)) → ACTIVE(head(active(false)))
MARK(tail(head(x0))) → ACTIVE(tail(active(head(mark(x0)))))
MARK(if(sieve(x0), y1, y2)) → ACTIVE(if(active(sieve(mark(x0))), y1, y2))
MARK(filter(X1, X2)) → MARK(X2)
MARK(s(X)) → MARK(X)
ACTIVE(sieve(cons(X, Y))) → MARK(cons(X, filter(X, sieve(Y))))
MARK(sieve(cons(x0, x1))) → ACTIVE(sieve(active(cons(mark(x0), x1))))
MARK(tail(false)) → ACTIVE(tail(active(false)))
MARK(sieve(false)) → ACTIVE(sieve(false))
MARK(filter(from(x0), y1)) → ACTIVE(filter(active(from(mark(x0))), mark(y1)))
MARK(filter(tail(x0), y1)) → ACTIVE(filter(active(tail(mark(x0))), mark(y1)))
MARK(tail(cons(x0, x1))) → ACTIVE(tail(active(cons(mark(x0), x1))))
MARK(tail(x0)) → ACTIVE(tail(x0))
MARK(filter(y0, cons(x0, x1))) → ACTIVE(filter(mark(y0), active(cons(mark(x0), x1))))
MARK(if(s(x0), y1, y2)) → ACTIVE(if(active(s(mark(x0))), y1, y2))
MARK(divides(X1, X2)) → MARK(X2)
MARK(filter(y0, sieve(x0))) → ACTIVE(filter(mark(y0), active(sieve(mark(x0)))))
MARK(divides(X1, X2)) → MARK(X1)
MARK(head(sieve(x0))) → ACTIVE(head(active(sieve(mark(x0)))))
MARK(sieve(X)) → MARK(X)
MARK(filter(y0, filter(x0, x1))) → ACTIVE(filter(mark(y0), active(filter(mark(x0), mark(x1)))))
MARK(filter(x0, y1)) → ACTIVE(filter(x0, mark(y1)))
ACTIVE(if(true, X, Y)) → MARK(X)
MARK(if(y0, x1, active(x2))) → ACTIVE(if(mark(y0), x1, x2))
ACTIVE(tail(cons(X, Y))) → MARK(Y)
MARK(tail(divides(x0, x1))) → ACTIVE(tail(active(divides(mark(x0), mark(x1)))))
MARK(filter(y0, from(x0))) → ACTIVE(filter(mark(y0), active(from(mark(x0)))))
MARK(head(X)) → MARK(X)
MARK(tail(X)) → MARK(X)
MARK(cons(X1, X2)) → MARK(X1)
MARK(tail(if(x0, x1, x2))) → ACTIVE(tail(active(if(mark(x0), x1, x2))))
MARK(head(divides(x0, x1))) → ACTIVE(head(active(divides(mark(x0), mark(x1)))))
ACTIVE(filter(s(s(X)), cons(Y, Z))) → MARK(if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y)))))
MARK(if(y0, x1, mark(x2))) → ACTIVE(if(mark(y0), x1, x2))
MARK(sieve(if(x0, x1, x2))) → ACTIVE(sieve(active(if(mark(x0), x1, x2))))
MARK(filter(y0, tail(x0))) → ACTIVE(filter(mark(y0), active(tail(mark(x0)))))
MARK(sieve(s(x0))) → ACTIVE(sieve(active(s(mark(x0)))))
MARK(sieve(primes)) → ACTIVE(sieve(active(primes)))
MARK(filter(y0, if(x0, x1, x2))) → ACTIVE(filter(mark(y0), active(if(mark(x0), x1, x2))))
MARK(head(filter(x0, x1))) → ACTIVE(head(active(filter(mark(x0), mark(x1)))))
MARK(sieve(divides(x0, x1))) → ACTIVE(sieve(active(divides(mark(x0), mark(x1)))))
MARK(if(x0, x1, x2)) → ACTIVE(if(x0, x1, x2))
MARK(filter(sieve(x0), y1)) → ACTIVE(filter(active(sieve(mark(x0))), mark(y1)))
MARK(filter(y0, s(x0))) → ACTIVE(filter(mark(y0), active(s(mark(x0)))))
MARK(if(head(x0), y1, y2)) → ACTIVE(if(active(head(mark(x0))), y1, y2))
MARK(if(y0, mark(x1), x2)) → ACTIVE(if(mark(y0), x1, x2))
MARK(tail(s(x0))) → ACTIVE(tail(active(s(mark(x0)))))
MARK(if(if(x0, x1, x2), y1, y2)) → ACTIVE(if(active(if(mark(x0), x1, x2)), y1, y2))
MARK(tail(0)) → ACTIVE(tail(active(0)))
MARK(primes) → ACTIVE(primes)
MARK(tail(true)) → ACTIVE(tail(active(true)))
ACTIVE(if(false, X, Y)) → MARK(Y)
MARK(tail(primes)) → ACTIVE(tail(active(primes)))
MARK(filter(s(x0), y1)) → ACTIVE(filter(active(s(mark(x0))), mark(y1)))
MARK(if(true, y1, y2)) → ACTIVE(if(active(true), y1, y2))
MARK(if(primes, y1, y2)) → ACTIVE(if(active(primes), y1, y2))
MARK(sieve(tail(x0))) → ACTIVE(sieve(active(tail(mark(x0)))))
MARK(if(tail(x0), y1, y2)) → ACTIVE(if(active(tail(mark(x0))), y1, y2))
MARK(sieve(from(x0))) → ACTIVE(sieve(active(from(mark(x0)))))
MARK(filter(filter(x0, x1), y1)) → ACTIVE(filter(active(filter(mark(x0), mark(x1))), mark(y1)))
MARK(filter(y0, 0)) → ACTIVE(filter(mark(y0), active(0)))
MARK(filter(0, y1)) → ACTIVE(filter(active(0), mark(y1)))
MARK(if(filter(x0, x1), y1, y2)) → ACTIVE(if(active(filter(mark(x0), mark(x1))), y1, y2))
MARK(filter(head(x0), y1)) → ACTIVE(filter(active(head(mark(x0))), mark(y1)))
MARK(filter(divides(x0, x1), y1)) → ACTIVE(filter(active(divides(mark(x0), mark(x1))), mark(y1)))
MARK(from(X)) → MARK(X)
MARK(if(divides(x0, x1), y1, y2)) → ACTIVE(if(active(divides(mark(x0), mark(x1))), y1, y2))
MARK(tail(tail(x0))) → ACTIVE(tail(active(tail(mark(x0)))))
MARK(head(from(x0))) → ACTIVE(head(active(from(mark(x0)))))
MARK(head(true)) → ACTIVE(head(active(true)))
MARK(if(cons(x0, x1), y1, y2)) → ACTIVE(if(active(cons(mark(x0), x1)), y1, y2))
ACTIVE(primes) → MARK(sieve(from(s(s(0)))))
MARK(filter(X1, X2)) → MARK(X1)
MARK(head(s(x0))) → ACTIVE(head(active(s(mark(x0)))))
MARK(if(false, y1, y2)) → ACTIVE(if(active(false), y1, y2))
MARK(filter(y0, head(x0))) → ACTIVE(filter(mark(y0), active(head(mark(x0)))))
MARK(filter(if(x0, x1, x2), y1)) → ACTIVE(filter(active(if(mark(x0), x1, x2)), mark(y1)))
MARK(from(X)) → ACTIVE(from(mark(X)))
ACTIVE(head(cons(X, Y))) → MARK(X)
MARK(sieve(head(x0))) → ACTIVE(sieve(active(head(mark(x0)))))
MARK(filter(false, y1)) → ACTIVE(filter(active(false), mark(y1)))
MARK(filter(y0, false)) → ACTIVE(filter(mark(y0), active(false)))
MARK(tail(from(x0))) → ACTIVE(tail(active(from(mark(x0)))))
MARK(filter(y0, primes)) → ACTIVE(filter(mark(y0), active(primes)))
MARK(filter(primes, y1)) → ACTIVE(filter(active(primes), mark(y1)))
MARK(if(from(x0), y1, y2)) → ACTIVE(if(active(from(mark(x0))), y1, y2))
MARK(filter(y0, divides(x0, x1))) → ACTIVE(filter(mark(y0), active(divides(mark(x0), mark(x1)))))
MARK(filter(cons(x0, x1), y1)) → ACTIVE(filter(active(cons(mark(x0), x1)), mark(y1)))

The TRS R consists of the following rules:

active(primes) → mark(sieve(from(s(s(0)))))
active(from(X)) → mark(cons(X, from(s(X))))
active(head(cons(X, Y))) → mark(X)
active(tail(cons(X, Y))) → mark(Y)
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(filter(s(s(X)), cons(Y, Z))) → mark(if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y)))))
active(sieve(cons(X, Y))) → mark(cons(X, filter(X, sieve(Y))))
mark(primes) → active(primes)
mark(sieve(X)) → active(sieve(mark(X)))
mark(from(X)) → active(from(mark(X)))
mark(s(X)) → active(s(mark(X)))
mark(0) → active(0)
mark(cons(X1, X2)) → active(cons(mark(X1), X2))
mark(head(X)) → active(head(mark(X)))
mark(tail(X)) → active(tail(mark(X)))
mark(if(X1, X2, X3)) → active(if(mark(X1), X2, X3))
mark(true) → active(true)
mark(false) → active(false)
mark(filter(X1, X2)) → active(filter(mark(X1), mark(X2)))
mark(divides(X1, X2)) → active(divides(mark(X1), mark(X2)))
sieve(mark(X)) → sieve(X)
sieve(active(X)) → sieve(X)
from(mark(X)) → from(X)
from(active(X)) → from(X)
s(mark(X)) → s(X)
s(active(X)) → s(X)
cons(mark(X1), X2) → cons(X1, X2)
cons(X1, mark(X2)) → cons(X1, X2)
cons(active(X1), X2) → cons(X1, X2)
cons(X1, active(X2)) → cons(X1, X2)
head(mark(X)) → head(X)
head(active(X)) → head(X)
tail(mark(X)) → tail(X)
tail(active(X)) → tail(X)
if(mark(X1), X2, X3) → if(X1, X2, X3)
if(X1, mark(X2), X3) → if(X1, X2, X3)
if(X1, X2, mark(X3)) → if(X1, X2, X3)
if(active(X1), X2, X3) → if(X1, X2, X3)
if(X1, active(X2), X3) → if(X1, X2, X3)
if(X1, X2, active(X3)) → if(X1, X2, X3)
filter(mark(X1), X2) → filter(X1, X2)
filter(X1, mark(X2)) → filter(X1, X2)
filter(active(X1), X2) → filter(X1, X2)
filter(X1, active(X2)) → filter(X1, X2)
divides(mark(X1), X2) → divides(X1, X2)
divides(X1, mark(X2)) → divides(X1, X2)
divides(active(X1), X2) → divides(X1, X2)
divides(X1, active(X2)) → divides(X1, X2)

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
The approximation of the Dependency Graph [15,17,22] contains 1 SCC with 1 less node.

↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
            ↳ QDPOrderProof
              ↳ QDP
                ↳ Narrowing
                  ↳ QDP
                    ↳ Narrowing
                      ↳ QDP
                        ↳ Narrowing
                          ↳ QDP
                            ↳ Narrowing
                              ↳ QDP
                                ↳ Narrowing
                                  ↳ QDP
                                    ↳ Narrowing
                                      ↳ QDP
                                        ↳ DependencyGraphProof
                                          ↳ QDP
                                            ↳ Narrowing
                                              ↳ QDP
                                                ↳ DependencyGraphProof
                                                  ↳ QDP
                                                    ↳ Narrowing
                                                      ↳ QDP
                                                        ↳ DependencyGraphProof
QDP

Q DP problem:
The TRS P consists of the following rules:

MARK(filter(y0, x1)) → ACTIVE(filter(mark(y0), x1))
MARK(sieve(sieve(x0))) → ACTIVE(sieve(active(sieve(mark(x0)))))
MARK(if(0, y1, y2)) → ACTIVE(if(active(0), y1, y2))
MARK(head(if(x0, x1, x2))) → ACTIVE(head(active(if(mark(x0), x1, x2))))
MARK(if(y0, active(x1), x2)) → ACTIVE(if(mark(y0), x1, x2))
MARK(tail(sieve(x0))) → ACTIVE(tail(active(sieve(mark(x0)))))
MARK(head(primes)) → ACTIVE(head(active(primes)))
MARK(sieve(filter(x0, x1))) → ACTIVE(sieve(active(filter(mark(x0), mark(x1)))))
MARK(head(0)) → ACTIVE(head(active(0)))
MARK(head(tail(x0))) → ACTIVE(head(active(tail(mark(x0)))))
MARK(if(X1, X2, X3)) → MARK(X1)
MARK(head(cons(x0, x1))) → ACTIVE(head(active(cons(mark(x0), x1))))
MARK(sieve(x0)) → ACTIVE(sieve(x0))
ACTIVE(from(X)) → MARK(cons(X, from(s(X))))
MARK(filter(true, y1)) → ACTIVE(filter(active(true), mark(y1)))
MARK(filter(y0, true)) → ACTIVE(filter(mark(y0), active(true)))
MARK(head(x0)) → ACTIVE(head(x0))
MARK(tail(filter(x0, x1))) → ACTIVE(tail(active(filter(mark(x0), mark(x1)))))
MARK(head(head(x0))) → ACTIVE(head(active(head(mark(x0)))))
MARK(head(false)) → ACTIVE(head(active(false)))
MARK(tail(head(x0))) → ACTIVE(tail(active(head(mark(x0)))))
MARK(if(sieve(x0), y1, y2)) → ACTIVE(if(active(sieve(mark(x0))), y1, y2))
MARK(filter(X1, X2)) → MARK(X2)
MARK(s(X)) → MARK(X)
ACTIVE(sieve(cons(X, Y))) → MARK(cons(X, filter(X, sieve(Y))))
MARK(sieve(cons(x0, x1))) → ACTIVE(sieve(active(cons(mark(x0), x1))))
MARK(tail(false)) → ACTIVE(tail(active(false)))
MARK(filter(from(x0), y1)) → ACTIVE(filter(active(from(mark(x0))), mark(y1)))
MARK(filter(tail(x0), y1)) → ACTIVE(filter(active(tail(mark(x0))), mark(y1)))
MARK(tail(cons(x0, x1))) → ACTIVE(tail(active(cons(mark(x0), x1))))
MARK(tail(x0)) → ACTIVE(tail(x0))
MARK(filter(y0, cons(x0, x1))) → ACTIVE(filter(mark(y0), active(cons(mark(x0), x1))))
MARK(if(s(x0), y1, y2)) → ACTIVE(if(active(s(mark(x0))), y1, y2))
MARK(divides(X1, X2)) → MARK(X2)
MARK(filter(y0, sieve(x0))) → ACTIVE(filter(mark(y0), active(sieve(mark(x0)))))
MARK(divides(X1, X2)) → MARK(X1)
MARK(sieve(X)) → MARK(X)
MARK(head(sieve(x0))) → ACTIVE(head(active(sieve(mark(x0)))))
MARK(filter(y0, filter(x0, x1))) → ACTIVE(filter(mark(y0), active(filter(mark(x0), mark(x1)))))
ACTIVE(if(true, X, Y)) → MARK(X)
MARK(filter(x0, y1)) → ACTIVE(filter(x0, mark(y1)))
ACTIVE(tail(cons(X, Y))) → MARK(Y)
MARK(if(y0, x1, active(x2))) → ACTIVE(if(mark(y0), x1, x2))
MARK(tail(divides(x0, x1))) → ACTIVE(tail(active(divides(mark(x0), mark(x1)))))
MARK(filter(y0, from(x0))) → ACTIVE(filter(mark(y0), active(from(mark(x0)))))
MARK(tail(X)) → MARK(X)
MARK(head(X)) → MARK(X)
MARK(cons(X1, X2)) → MARK(X1)
MARK(tail(if(x0, x1, x2))) → ACTIVE(tail(active(if(mark(x0), x1, x2))))
MARK(if(y0, x1, mark(x2))) → ACTIVE(if(mark(y0), x1, x2))
ACTIVE(filter(s(s(X)), cons(Y, Z))) → MARK(if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y)))))
MARK(head(divides(x0, x1))) → ACTIVE(head(active(divides(mark(x0), mark(x1)))))
MARK(sieve(if(x0, x1, x2))) → ACTIVE(sieve(active(if(mark(x0), x1, x2))))
MARK(filter(y0, tail(x0))) → ACTIVE(filter(mark(y0), active(tail(mark(x0)))))
MARK(sieve(s(x0))) → ACTIVE(sieve(active(s(mark(x0)))))
MARK(sieve(primes)) → ACTIVE(sieve(active(primes)))
MARK(filter(y0, if(x0, x1, x2))) → ACTIVE(filter(mark(y0), active(if(mark(x0), x1, x2))))
MARK(head(filter(x0, x1))) → ACTIVE(head(active(filter(mark(x0), mark(x1)))))
MARK(sieve(divides(x0, x1))) → ACTIVE(sieve(active(divides(mark(x0), mark(x1)))))
MARK(if(x0, x1, x2)) → ACTIVE(if(x0, x1, x2))
MARK(filter(sieve(x0), y1)) → ACTIVE(filter(active(sieve(mark(x0))), mark(y1)))
MARK(filter(y0, s(x0))) → ACTIVE(filter(mark(y0), active(s(mark(x0)))))
MARK(if(head(x0), y1, y2)) → ACTIVE(if(active(head(mark(x0))), y1, y2))
MARK(tail(s(x0))) → ACTIVE(tail(active(s(mark(x0)))))
MARK(if(y0, mark(x1), x2)) → ACTIVE(if(mark(y0), x1, x2))
MARK(tail(0)) → ACTIVE(tail(active(0)))
MARK(if(if(x0, x1, x2), y1, y2)) → ACTIVE(if(active(if(mark(x0), x1, x2)), y1, y2))
MARK(primes) → ACTIVE(primes)
MARK(tail(true)) → ACTIVE(tail(active(true)))
ACTIVE(if(false, X, Y)) → MARK(Y)
MARK(tail(primes)) → ACTIVE(tail(active(primes)))
MARK(if(primes, y1, y2)) → ACTIVE(if(active(primes), y1, y2))
MARK(if(true, y1, y2)) → ACTIVE(if(active(true), y1, y2))
MARK(filter(s(x0), y1)) → ACTIVE(filter(active(s(mark(x0))), mark(y1)))
MARK(if(tail(x0), y1, y2)) → ACTIVE(if(active(tail(mark(x0))), y1, y2))
MARK(sieve(tail(x0))) → ACTIVE(sieve(active(tail(mark(x0)))))
MARK(sieve(from(x0))) → ACTIVE(sieve(active(from(mark(x0)))))
MARK(filter(filter(x0, x1), y1)) → ACTIVE(filter(active(filter(mark(x0), mark(x1))), mark(y1)))
MARK(filter(0, y1)) → ACTIVE(filter(active(0), mark(y1)))
MARK(filter(y0, 0)) → ACTIVE(filter(mark(y0), active(0)))
MARK(if(filter(x0, x1), y1, y2)) → ACTIVE(if(active(filter(mark(x0), mark(x1))), y1, y2))
MARK(filter(head(x0), y1)) → ACTIVE(filter(active(head(mark(x0))), mark(y1)))
MARK(filter(divides(x0, x1), y1)) → ACTIVE(filter(active(divides(mark(x0), mark(x1))), mark(y1)))
MARK(from(X)) → MARK(X)
MARK(if(divides(x0, x1), y1, y2)) → ACTIVE(if(active(divides(mark(x0), mark(x1))), y1, y2))
MARK(head(from(x0))) → ACTIVE(head(active(from(mark(x0)))))
MARK(tail(tail(x0))) → ACTIVE(tail(active(tail(mark(x0)))))
MARK(if(cons(x0, x1), y1, y2)) → ACTIVE(if(active(cons(mark(x0), x1)), y1, y2))
MARK(head(true)) → ACTIVE(head(active(true)))
ACTIVE(primes) → MARK(sieve(from(s(s(0)))))
MARK(filter(X1, X2)) → MARK(X1)
MARK(head(s(x0))) → ACTIVE(head(active(s(mark(x0)))))
MARK(if(false, y1, y2)) → ACTIVE(if(active(false), y1, y2))
MARK(filter(y0, head(x0))) → ACTIVE(filter(mark(y0), active(head(mark(x0)))))
MARK(filter(if(x0, x1, x2), y1)) → ACTIVE(filter(active(if(mark(x0), x1, x2)), mark(y1)))
MARK(from(X)) → ACTIVE(from(mark(X)))
MARK(sieve(head(x0))) → ACTIVE(sieve(active(head(mark(x0)))))
ACTIVE(head(cons(X, Y))) → MARK(X)
MARK(tail(from(x0))) → ACTIVE(tail(active(from(mark(x0)))))
MARK(filter(y0, false)) → ACTIVE(filter(mark(y0), active(false)))
MARK(filter(false, y1)) → ACTIVE(filter(active(false), mark(y1)))
MARK(filter(primes, y1)) → ACTIVE(filter(active(primes), mark(y1)))
MARK(filter(y0, primes)) → ACTIVE(filter(mark(y0), active(primes)))
MARK(if(from(x0), y1, y2)) → ACTIVE(if(active(from(mark(x0))), y1, y2))
MARK(filter(y0, divides(x0, x1))) → ACTIVE(filter(mark(y0), active(divides(mark(x0), mark(x1)))))
MARK(filter(cons(x0, x1), y1)) → ACTIVE(filter(active(cons(mark(x0), x1)), mark(y1)))

The TRS R consists of the following rules:

active(primes) → mark(sieve(from(s(s(0)))))
active(from(X)) → mark(cons(X, from(s(X))))
active(head(cons(X, Y))) → mark(X)
active(tail(cons(X, Y))) → mark(Y)
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(filter(s(s(X)), cons(Y, Z))) → mark(if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y)))))
active(sieve(cons(X, Y))) → mark(cons(X, filter(X, sieve(Y))))
mark(primes) → active(primes)
mark(sieve(X)) → active(sieve(mark(X)))
mark(from(X)) → active(from(mark(X)))
mark(s(X)) → active(s(mark(X)))
mark(0) → active(0)
mark(cons(X1, X2)) → active(cons(mark(X1), X2))
mark(head(X)) → active(head(mark(X)))
mark(tail(X)) → active(tail(mark(X)))
mark(if(X1, X2, X3)) → active(if(mark(X1), X2, X3))
mark(true) → active(true)
mark(false) → active(false)
mark(filter(X1, X2)) → active(filter(mark(X1), mark(X2)))
mark(divides(X1, X2)) → active(divides(mark(X1), mark(X2)))
sieve(mark(X)) → sieve(X)
sieve(active(X)) → sieve(X)
from(mark(X)) → from(X)
from(active(X)) → from(X)
s(mark(X)) → s(X)
s(active(X)) → s(X)
cons(mark(X1), X2) → cons(X1, X2)
cons(X1, mark(X2)) → cons(X1, X2)
cons(active(X1), X2) → cons(X1, X2)
cons(X1, active(X2)) → cons(X1, X2)
head(mark(X)) → head(X)
head(active(X)) → head(X)
tail(mark(X)) → tail(X)
tail(active(X)) → tail(X)
if(mark(X1), X2, X3) → if(X1, X2, X3)
if(X1, mark(X2), X3) → if(X1, X2, X3)
if(X1, X2, mark(X3)) → if(X1, X2, X3)
if(active(X1), X2, X3) → if(X1, X2, X3)
if(X1, active(X2), X3) → if(X1, X2, X3)
if(X1, X2, active(X3)) → if(X1, X2, X3)
filter(mark(X1), X2) → filter(X1, X2)
filter(X1, mark(X2)) → filter(X1, X2)
filter(active(X1), X2) → filter(X1, X2)
filter(X1, active(X2)) → filter(X1, X2)
divides(mark(X1), X2) → divides(X1, X2)
divides(X1, mark(X2)) → divides(X1, X2)
divides(active(X1), X2) → divides(X1, X2)
divides(X1, active(X2)) → divides(X1, X2)

Q is empty.
We have to consider all minimal (P,Q,R)-chains.